Loading

更改Nginx配置记录

通过docker部署的nginx容器的nginx默认配置文件在/etc/nginx/conf.d/default.conf

server {
    #监听端口
    listen       80;
    #服务器名称
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

    #服务器根路径配置
    location / {
        #根路径
        root   /usr/share/nginx/html;
        #主页文件
        index  index.html index.htm;
    }

    #404错误页面文件
    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    #50x错误页面文件
    error_page   500 502 503 504  /50x.html;
    #50x错误页面路径配置
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

修改配置文件后重启NGINX

# service nginx restart

posted @ 2021-10-20 17:28  Biem  阅读(157)  评论(0编辑  收藏  举报