我正在尝试使以下设置与 gunicorn 和 nginx 一起使用。一切正常,直到我添加第二个server
配置......
upstream app_server_djangoapp {
server localhost:8002 fail_timeout=0;
}
server {
listen 80;
server_name api.domain.tld;
access_log /var/log/nginx/guni-access.log;
error_log /var/log/nginx/guni-error.log info;
keepalive_timeout 5;
# Size in megabytes to allow for uploads.
client_max_body_size 20M;
# path for static files
root /home/username/webapps/guni/static;
location /docs/ {
autoindex on;
alias /srv/site/docs/buildHTML/html/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server_djangoapp;
break;
}
}
}
server {
listen 80;
server_name flower.domain.tld;
location / {
proxy_pass http://localhost:5555;
}
我做错了什么?我需要有两个子域,一个映射到我的 django 应用程序,另一个映射到我在 5555 上的监控软件(花)
日志文件状态:
2014/11/21 12:03:27 [emerg] 962#0:文件意外结束,在 /etc/nginx/sites-enabled/default:47 中期待“}”