我正在尝试使用 nginx 作为代理,以便http://stuff.theanti9.com/转到单独的计算机,其他一切都转到 Apache 的本地实例(将由http://theanti9.com或者http://www.theanti9.com)。我尝试配置它,但是当我进入我的域时,我只得到“欢迎使用 nginx!”。这是我得到的:
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name theanti9.com www.theanti9.com;
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://localhost:8000;
}
}
server {
listen 80;
server_name stuff.theanti9.com;
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://192.168.1.102:80;
}
}
}
我不太清楚哪里出了问题。有什么建议吗?
答案1
检查 /etc/nginx/conf.d 中的文件。某些内容可能覆盖了你的设置