nginx 转将http跳转到https
2020-07-14 06:17
183 查看
#websoceket 使用map
map $http_upgrade $connection_upgrade {
default upgrade;
‘’ close;
}
upstream abc.com
{
server 47.***.**.1:8012;
}
server {
listen 80;
server_name www.abc.com abc.com;
rewrite ^(.) https://$host$1 permanent;
}
server
{
listen 443 ssl;
server_name www.abc.com abc.com;
index index.html index.htm index.php;
ssl on;
ssl_certificate /etc/letsencrypt/live/www.abc.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.abc.com/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
location / { proxy_pass http://abc.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header Connection ""; proxy_http_version 1.1; proxy_connect_timeout 1; proxy_send_timeout 30; proxy_read_timeout 60; } error_log logs/abc_error.log;
}
相关文章推荐
- nginx访问http80端口自动跳转https443端口
- Nginx跳转任意Http请求到Https
- Nginx跳转任意Http请求到Https
- nginx http自动跳转https post参数丢失问题
- nginx访问http80端口跳转https443端口
- 配置Nginx网站https访问、http共存访问、http强制跳转到https
- nginx强制使用https访问(http跳转到https)
- 【转】Nginx跳转任意Http请求到Https
- nginx强制使用https访问(http跳转到https)
- Nginx跳转任意Http请求到Https
- Nginx跳转任意Http请求到Https
- nginx配置https并强制http自动跳转到https
- Nginx配置SSL并强制http跳转到https
- Nginx跳转任意Http请求到Https
- 使用nginx实现http访问自动跳转到https端口
- 详解NGINX访问https跳转到http的解决方法
- Nginx配置http强制跳转到https
- nginx实现某个页面http访问,其余全部跳转到https
- Nginx安装配置SSL证书并强制http跳转到https
- Nginx跳转任意Http请求到Https