0
嘿傢伙我有一個nginx代理的問題。Nginx代理設置
我想設置它將所有請求重定向到一個外部站點(已經有)。
但是,除了在域hg.mydomain.com這些請求,我想重定向到本地主機請求:4567(西納特拉應用住在那裏)
但是,這並不工作
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
server {
listen 80;
server_name *.hg.mydomain.com;
location/{
proxy_pass http://127.0.0.1:4567/;
}
}
server {
listen 80;
location/{
proxy_pass http://sb.mydomain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Shoebox-Host $host;
}
}
}