• nginx http https 配置案例


    linux nginx 配置

    server{
            listen 80;
            server_name www.worldsipo.com;
            index index.html index.htm index.php;
            root  /home/wwwroot/default/*****/public;
    
            #error_page   404   /404.html;
            #include enable-php.conf;
            include enable-php-pathinfo.conf;
            location /nginx_status
            {
                stub_status on;
                access_log   off;
            }
            location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires      30d;
            }
    
            location ~ .*.(js|css)?$
            {
                expires      12h;
            }
    
            location ~ /.
            {
                deny all;
            }
    
            access_log  /home/wwwlogs/access-jiuling.log;
    }
    
    
    server{
        #listen 80;
        listen 443 ssl;
        server_name www.worldsipo.com;
        index index.htm index.php admin.php;
        try_files $uri $uri/ /index.html;
        root  /home/wwwroot/default/*****/public;
        ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
        ssl_certificate worldsipo.com_chain.crt;
        ssl_certificate_key worldsipo.com_key.key;
        ssl_prefer_server_ciphers on;
    
    	add_header Last-Modified $date_gmt;
        add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        if_modified_since off;
        expires off;
        etag off;
    
        #error_page   404   /404.html;
        include enable-php-pathinfo.conf;
    	
    	location ^~ /admin.php {
            #allow 218.93.209.11;
    	    #deny all;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
    	    #fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
            include pathinfo.conf;
    	}
    	
        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }
    
        #location / {
        #    if (!-e $request_filename) {
        #        rewrite  ^(.*)$  /index.php?s=/$1  last;
        #    }
        #}
    
        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }
    
        location ~ .*.(js|css)?$
        {
            #expires      -1;
            expires      12h;
        }
    
        location ~ /.
        {
            deny all;
        }
    
        access_log  /home/wwwlogs/access-jiuling.log;
    }
    
    
    相信坚持的力量,日复一日的习惯.
  • 相关阅读:
    Qt 3D教程(二)初步显示3D的内容
    linux关于ftp查看不到文件列表的问题
    Mahout推荐算法API具体解释【一起学Mahout】
    GBK编码具体解析(附GBK码位分布图)
    HTML5实战与剖析之媒体元素(3、媒体元素的事件及方法)
    CentOS添加swap分区
    Transaction: atomicity, consistency, separability, persistence
    redis ins 调试
    jemalloc/jemalloc.h: No such file or directory
    MySQL表设计基础
  • 原文地址:https://www.cnblogs.com/pansidong/p/14435985.html
Copyright © 2020-2023  润新知