wenwei7532 大佬有话说 :
宝塔7.2.0怎么修改成SSL和反代共存
本帖最后由 wenwei7532 于 2020-5-31 09:13 编辑
server
{
listen 8081;
server_name q1.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/q1.com;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-STARTPHP引用配置,可以注释或修改
include enable-php-56.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/q1.com.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ .well-known{
allow all;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
location ~ .*.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
access_log/www/wwwlogs/q1.com.log;
error_log/www/wwwlogs/q1.com.error.log;
}
<VirtualHost *:8081>
ServerAdmin [email protected]
DocumentRoot "/www/wwwroot/q1.com"
ServerName 660e3822.q1.com
ServerAlias q1.com
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/q1.com-error_log"
CustomLog "/www/wwwlogs/q1.com-access_log" combined
#DENY FILES
<Files ~ (.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PHP
<FilesMatch .php$>
SetHandler "proxy:unix:/tmp/php-cgi-56.sock|fcgi://localhost"
</FilesMatch>
#PATH
<Directory "/www/wwwroot/q1.com">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</Directory>
</VirtualHost>
宝塔7.2.0怎么修改成SSL和反代共存呢
谢谢了
字数补丁
mcjames 大佬有话说 :
帮顶,zsbdhttps://cdn.jsdelivr.net/gh/hishis/forum-master/public/images/patch.gifhttp://d0.ananas.chaoxing.com/download/23ebdda8f5b410107b6a9c6699537ef0https://assets.baklib.com/5467817c-6514-4e6d-bb4b-386f8de94d26/null1590840738873.gif
爱吃醋的醋醋 大佬有话说 :
ssl本来就可以,先反代,在填证书
wenwei7532 大佬有话说 :
爱吃醋的醋醋 大佬有话说 : 2020-5-31 09:07
ssl本来就可以,先反代,在填证书
填证书使用https访问直接
“您访问的网页出错了!
网络连接异常、网站服务器失去响应”
字数补丁
萌䒤萌 大佬有话说 :
刚把7.1.2更新到7.2,以前的反代站点一切正常
dj215 大佬有话说 :
反代后还能够开启SSL吗?
wenwei7532 大佬有话说 :
dj215 大佬有话说 : 2020-5-31 09:15
反代后还能够开启SSL吗?
反代后可以部署证书。但是部署后访问不了。不知道要怎么修改了
字数补丁
萌䒤萌 大佬有话说 :
dj215 大佬有话说 : 2020-5-31 09:15
反代后还能够开启SSL吗?
反代后用let’s证书的话不能用文件验证,用DNS验证可以签发证书