Install OpenProject on Ubuntu 12.04 with nginx

June 11, 2014 6.3k views
Hey guys, I'm running a Linux server on DigitalOcena where i have installed couple of Wordpress websites in LEMP environment (*). Now I want to install OpenProject (info at https://OpenProject.org ) for my team in subdomain following this tutorial: https://www.openproject.org/projects/openproject/wiki/Installation_Ubuntu The tutorial seams easy, but i wonder what should be the nginx server block configuration at the etc/nginx/sites-available. Any help? Thank you! (*) I have followed this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04 to instal 2 websites, one in a domain.com and other in a sub.domain.com . It worked perfectly!
1 Answer
Looking at the installation instructions, it looks like it is a rails app the is served on port 3000. So you'd simply need to add a server block that acts as a reverse proxy. It would look something like:
upstream app_server {
    server fail_timeout=0;

server { 
    listen 80; 
    server_name projects.example.com; 
    root /path/to/openproject/public;

     location / {
           try_files $uri/index.html $uri.html $uri @app;     

     location @app {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_pass http://app_server;
For production, you'll probably want to look into using something like passenger to serve the app.
  • Thank you soo much Astarr! On more question, is it absolutely required to have passenger, or it can run without? sorry i'm a beginner and i'm still trying to understand why you recommend it. Thank you for your help again!
  • No it's not absolutely essential, but it is useful especially if you are going to have a large number of users. Passenger, and other app servers like Unicorn and Puma, help your app scale up as they are multi-process apps. They'll launch new worker processes as needed and are generally more efficient resource wise.
  • @astarr, thank you for your insight! ;) i will try it out soon. best!
Have another answer? Share your knowledge.