w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How configure nginx for rails app as subdomain?

Add new confing file to /etc/nginx/sites-enabled: redmine.config

server {
    listen   80;
    root /home/redmine/;
    server_name redmine.head-system.com;
    index index.htm index.html;

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

  location ~*
^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi)$
{
        try_files $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://localhost:3000;
  }

}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.