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

  • 相关阅读:
    谈谈SpringFramework与IoC依赖查找
    监控微博、论坛的“棱镜计划”
    输出质数的方法改进
    参数解构
    直接插入排序
    理解迭代
    异常处理
    函数
    continue语句
    break语句
  • 原文地址:https://www.cnblogs.com/biem/p/15429848.html
Copyright © 2011-2022 走看看