我有一个运行在localhost:1337
的node.js服务器。我已经在sites_enabled
中创建了一个nginx站点文件。如果我访问urladmin.tvchatter.cn:1337
,它可以正常工作,但是如果我访问urladmin.tvchatter.cn
,页面仍然显示“欢迎使用nginx!”。看起来listen 80
没有起作用。文件内容如下:
server {
listen 80;
server_name admin.tvchatter.cn;
access_log /var/log/nginx/admin.tvchatter.cn.access.log;
error_log /var/log/nginx/admin.tvchatter.cn.error.log;
client_max_body_size 200m;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/javascript text/css application/xml;
gzip_vary on;
location /{
proxy_pass http://127.0.0.1:1337;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}