我正在部署一个带有 jar 文件的网站。这是我设置的第一台服务器,所以我对在这里做什么有点迷茫。我的 nginx.config 中有这个:
server{
listen 80;
server_name www.mySite.com;
return 301 $scheme://mySite.com$request_uri;
}
server {
listen 80;
server_name mySite.com;
location / {
proxy_pass http://localhost:3000 ;
}
.....
我根据文档设置了 CNAME。
我已经尝试了几种资源来解决这个问题:
http://nginx.org/en/docs/http/converting_rewrite_rules.html
Nginx no-www 到 www 和 www 到 no-www
http://rtcamp.com/wordpress-nginx/tutorials/nginx/www-non-www-redirection/
并不断收到相同的错误:
$ systemctl status nginx.service
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Fri 2013-09-27 06:22:30 UTC; 11s ago
Process: 4492 ExecStop=/usr/bin/nginx -g pid /run/nginx.pid; -s quit (code=exited, status=1/FAILURE)
Process: 3705 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 4495 ExecStartPre=/usr/bin/nginx -t -q -g pid /run/nginx.pid; daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 3706 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/nginx.service