run multiple applications on same ip using nginx

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        #root /usr/share/nginx/html;
        server_name 108.174.155.117;
        passenger_enabled on;
        rails_env    production;
        root         /home/app/test-runner/public;
         error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #    root   html;
        #}
        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        #server_name _;
         #server_name _;

        #location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
        #       try_files $uri $uri/ =404;
        #}


        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
               #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
        #       fastcgi_pass unix:/var/run/php5-fpm.sock;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}



server {
        listen 8888 default_server;
        listen [::]:8888 default_server ipv6only=on;

        server_name  108.174.155.117;
        passenger_enabled on;
        rails_env    production;
        root         /home/app/infinite-scroller/public;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #    root   html;
        #}


server {
        listen 8001 default_server;
        listen [::]:8001 default_server ipv6only=on;

        server_name  108.174.155.117;
        passenger_enabled on;
        rails_env    production;
        root         /home/app/sport-buddy/public;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #    root   html;
        #}
}

Comments

  1. Your blog is in a convincing manner, thanks for sharing such an information with lots of your effort and time
    ruby on rails training India
    ruby on rails training Hyderabad

    ReplyDelete

Post a Comment