–
最近有这种需求,就是当用户通过内网访问的,http和https都支持
当用户通过公网访问的时候,http需要强制跳转到https访问,下面是具体配置
upstream p.andblog.com { server 10.16.5.50:80 max_fails=3 fail_timeout=30s weight=2; } server { listen 80; server_name p.andblog.com; access_log logs/p.andblog.com_access.log request_time_count; error_log logs/p.andblog.com_error.log; location / { include vhosts/innernet_conf; proxy_pass http://p.andblog.com; } error_page 403 https://$server_name$request_uri; } server { listen 443 ssl; server_name p.andblog.com; access_log logs/p.andblog.com_access.log request_time_count; error_log logs/p.andblog.com_error.log; location / { proxy_pass http://p.andblog.com; } } include的文件内容 allow 172.1.1.1/26; allow 10.1.1.1/32; deny all;
–
–
评论前必须登录!
注册