1. 程式人生 > 其它 >更改Nginx配置記錄

更改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;
    #}
}