के साथ एक सर्वर से दो साइटों की सेवा करना मेरे पास एक रेल ऐप है और मेरे सर्वर पर चल रहा है और अब मैं एक और जोड़ना चाहता हूं।Nginx
मैं Nginx क्या अनुरोध के लिए है और डोमेन नाम के आधार पर विभाजित यातायात
दोनों साइटों को अपने स्वयं के nginx.conf साइटों सक्षम में सांकेतिक रूप से लिंक है जाँच करना चाहते हैं, लेकिन मैं nginx शुरू करने में त्रुटि मिली Starting nginx: nginx: [emerg] duplicate listen options for 0.0.0.0:80 in /etc/nginx/sites-enabled/bubbles:6
वे दोनों 80 पर सुन रहे हैं लेकिन विभिन्न चीजों के लिए।
साइट # 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;
}
साइट दो:
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;
}
FYI करें, कॉन्फ़िगर किया गया था वाक्यविन्यास 'डिफ़ॉल्ट' 0.8.21 http://nginx.org/en/docs/http/request_processing में 'default_server' में बदल गया।एचटीएमएल – spuder
@ स्पूडर धन्यवाद, यह अचानक मेरे 'डिफ़ॉल्ट_सर्वर "पैरामीटर को डिफ़ॉल्ट" सुनवाई "निर्देश के लिए निर्दिष्ट किया जा सकता है केवल' त्रुटि – user3132194