服装图案素材网站,广告公司资质,网站一年费用,摄影网站免费源码问题描述#xff1a;
nginx 配置使用80端口#xff0c;自动跳转到欢迎页面#xff08;welcome to nginx#xff01;#xff09;#xff0c;但是其他端口可以正常使用
解决方法#xff1a;
配置文件目录#xff1a;
/etc/nginx/sites-enables/
在这个目录下面除了在…问题描述
nginx 配置使用80端口自动跳转到欢迎页面welcome to nginx但是其他端口可以正常使用
解决方法
配置文件目录
/etc/nginx/sites-enables/
在这个目录下面除了在自己写的配置文件×××.conf外还有一个default文件这个文件是默认加载的而配置文件编辑这个default文件打开以后是这样的
##
# You should look at the following URLs in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
### Default server configuration
#
server {listen 80 default_server; ## 这里默认欢迎页面是80端口把这个端口改成一个不用的端口号listen [::]:80 default_server; ## 这里默认欢迎页面是80端口改成一个不用的端口号# SSL configuration## listen 443 ssl default_server;# listen [::]:443 ssl default_server;## Note: You should disable gzip for SSL traffic.# See: https://bugs.debian.org/773332
可以看见里面欢迎页面默认的被80端口占用改成其他的端口即可解决被占用的问题。
最后kill pid重新启动nginx 输入url问题解决。