zoukankan      html  css  js  c++  java
  • 更改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

  • 相关阅读:
    竞赛题解
    学习笔记
    竞赛题解
    学习笔记
    竞赛题解
    竞赛题解
    竞赛题解
    「链接」原博客链接
    「杂录」THUWC 2020 游记
    「杂录」CSP-S 2019 爆炸记&题解
  • 原文地址:https://www.cnblogs.com/biem/p/15429848.html
Copyright © 2011-2022 走看看