最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Nginx配置SSL(https)虚拟主机的例子
时间:2022-11-14 22:07:24 编辑:袖梨 来源:一聚教程网
Nginx 的配置文件 111com.net.conf:
server {
listen 80;
server_name 111com.net;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443;
server_name 111com.net;
ssl on;
ssl_certificate /www/cert/111com.net_bundle.crt;
ssl_certificate_key /www/cert/111com.net.key;
root /www/111com.net;
index index.html index.php index.htm;
location ~ .php$ {
proxy_pass http://127.0.0.1:88;
include naproxy.conf;
}
location / {
try_files $uri @apache;
}
location @apache {
proxy_pass http://127.0.0.1:88;
include naproxy.conf;
}
#error_page 497 https://$host$uri?$args;
}
naproxy.conf:
proxy_connect_timeout 300s;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_redirect off;
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
proxy_set_header Host $host;
proxy_set_header Referer $http_referer;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Apache 的配置文件 111com.net.conf:
DocumentRoot /www/111com.net
ServerName 111com.net
php_admin_value open_basedir /www/111com.net:/tmp
DeflateCompressionLevel 7
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js html htm gif jpg png bmp php
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
相关文章
- 无期迷途哈梅尔依偎涟漪怎么样 11-25
- 剑与远征折翼苍空攻略 11-25
- 光遇11.25每日任务怎么做 光遇11月25日每日任务做法攻略 11-25
- 光遇11.25季节蜡烛在哪里 光遇11月25日季节蜡烛位置攻略 11-25
- 崩坏星穹铁道2.7前瞻有什么活动 崩铁2.7版本前瞻新增内容介绍 11-25
- “十月朝,糍粑碌碌烧”是说哪个习俗 蚂蚁庄园11月22日答案最新 11-25