I have a Rails application and it runs on my server, and now I would like to add another one.
I want Nginx to check what the request is for and to separate traffic based on the domain name
Both sites have their own nginx.conf, symbolically linked to sites, but I get an error message starting with nginx Starting nginx: nginx: [emerg] duplicate listen options for 0.0.0.0:80 in /etc/nginx/sites-enabled/bubbles:6
They listen to 80, but for different things.
Site number 1
upstream blog_unicorn { server unix:/tmp/unicorn.blog.sock fail_timeout=0; } server { listen 80 default deferred; server_name walrus.com www.walrus.com; root /home/deployer/apps/blog/current/public; location ^~ /assets/ { gzip_static on; expires max; add_header Cache-Control public; } try_files $uri/index.html $uri @blog_unicorn; location @blog_unicorn { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://blog_unicorn; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; }
Second site:
upstream bubbles_unicorn { server unix:/tmp/unicorn.bubbles.sock fail_timeout=0; } server { listen 80 default deferred; server_name bubbles.com www.bubbles.com; root /home/deployer/apps/bubbles/current/public; location ^~ /assets/ { gzip_static on; expires max; add_header Cache-Control public; } try_files $uri/index.html $uri @bubbles_unicorn; location @bubbles_unicorn { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://bubbles_unicorn; } error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; }
proxy nginx
Chris Dec 03 2018-12-12T00: 00Z
source share