nginx 도 메 인 이름 설정

2196 단어 서버
nginx 도 메 인 이름 설정
php 에서 http 설정
server {
        listen       80;
        server_name  ####    #######;
        root         #######      #########;
        client_max_body_size  1000m;
        location / {
            index  index.html index.php;
            try_files $uri $uri/ /index.php?$query_string;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

php 에서 https 설정

server {
        listen       443 ssl;
        server_name  ####    #######;
        root         #######      #########;
        client_max_body_size  1000m;
        ssl_certificate     /cert/fairy-card/4194999_fairy-card.qsqwei.com.pem;
        ssl_certificate_key /cert/fairy-card/4194999_fairy-card.qsqwei.com.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        location / {
            index  index.html index.php;
            try_files $uri $uri/ /index.php?$query_string;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}


도 메 인 이름 변경
server {
        listen       80;
        server_name  #####        ########;
        return 301 https://$host$request_uri;
}

좋은 웹페이지 즐겨찾기