【发布时间】:2014-06-27 18:12:21
【问题描述】:
我尝试使用带有 nginx + gunicorn 的 django 服务器和用于 php 的 lighttpd。我应该如何将 nginx 配置为我的子域到 lighttpd 的代理?
例如。
myawesomesite.com => dajango 网站(工作)
cloud.myawesomesite.com => lighttpd php 服务器(不工作)
我真的在尝试
server {
listen 80;
server_name cloud.awesome.eu;
location / {
proxy_pass http://127.0.0.1:8080;
#root /var/www;
}
}
对于 SSL
server {
listen 443 ssl;
#ssl on;
server_name cloud.awesome.eu;
#root /var/www;
#ssl_certificate /etc/nginx/ssl/server.crt;
#ssl_certificate_key /etc/nginx/ssl/server.key;
index index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host cloud.awesome.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
所有配置示例都是针对 nginx + apache.. 我没有找到 nginx + lighttpd 的示例。
对不起我糟糕的英语:)
【问题讨论】: