/etc/nginx/sites-enabled/mysite.conf listens to port 80
server {
listen 80;
server_name localhost;
location /static {
alias /home/alps/mysite/blog/static;
}
location / {
uwsgi_pass 127.0.0.1:8001;
include /etc/nginx/uwsgi_params;
}
}
localhost:80 It will jump to the nginx default interface instead of the welcome interface of my django project
my question
1. 结果浏览器里面访问localhost:80它会自动跳转到nginx默认的欢迎界面
2. 但是如果监听8080这些端口,localhost:8080可以跳转到正确的界面
3. 请问这是怎么回事呢?我应该如何设置?
It should be occupied by /etc/sites-enabled/default. Try removing the configuration or changing the port.
Visual inspection, the configuration file is written in the wrong place?
It’s because your project directory has not been written,
this parameter
Has nginx been restarted?
I have encountered this problem before. . Finally, it was discovered that the server's system's own nginx occupied port 80. . Just uninstall it.
You can judge like this: lsof -i:80
See which process is occupying it, then kill or uninstall it, and then start your own
nginx.conf has a default configuration of 80. If you don’t use the default configuration, add the domain name yourself and change hosts to access.
Why is it you again? You’ve been working on it for a week and you haven’t succeeded yet
Another configuration file is introduced in the configuration item
include /etc/nginx/conf.d/*.conf;
Comment out
That’s it