$ sudo vim /etc/nginx/sites-available/default
server_name localhost:3001;
location / {
root /root/web/bin/www;
index index.html index.ejs index.htm app.js;
proxy_pass http://127.0.0.1:3000;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
index index.html index.htm;
# Make site accessible from http://localhost/
#代理的域名
server_name www.facaila.tech;
location / {
#目标地址
root /data/web/469055;
index index.html index.ejs index.htm app.js;
# proxy_pass http://127.0.0.1:5000; #端口代理
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}