nginx 站点80跳443配置

Posted 爱技术不爱学技术

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 站点80跳443配置相关的知识,希望对你有一定的参考价值。

server {
listen 80;
server_name www.furhacker.cn;
location /{
# return 301;
rewrite ^(.*)$ https://$host$1 last;
#rewrite ^(.*)$ https://$host$1 permanent;
}
}

server {
listen 443;
server_name www.furhacker.cn;
root html;
index index.html index.php index.htm;
error_page 400 /errpage/400.html;
error_page 403 /errpage/403.html;
error_page 404 /errpage/404.html;

ssl on;
ssl_certificate_key server.key;
ssl_certificate server.pem;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
include rewrite/***.conf;
#charset koi8-r;

#access_log logs/host.access.log main;
location / {
root html;
index index.php index.html index.htm;
}




























以上是关于nginx 站点80跳443配置的主要内容,如果未能解决你的问题,请参考以下文章

nginx配置http访问自动跳转到https

Nginx配置HTTP强制跳转到HTTPS

Nginx一个ip上多站点80433httphttps共存设置

nginx http跳https配置

nginx-80重定向443

nginx http强制跳转https