标题:
[教程]
nginx ssl证书 apache ssl lanmp ssl 安装教程 https 服务
[打印本页]
作者:
374399415
时间:
2013-10-25 15:55
标题:
nginx ssl证书 apache ssl lanmp ssl 安装教程 https 服务
本帖最后由 374399415 于 2013-10-26 12:00 编辑
如果安装
Discuz!论坛程序的
不要使用ssh 或者wdCP后台直接上传这些操作会导致https无法显示图片(因为权限和用户组问题)
请使用ftp上传程序
2楼整理附上
作者:
374399415
时间:
2013-10-25 16:01
本帖最后由 374399415 于 2013-10-26 12:13 编辑
这是nginx 下虚拟主机配置文件
如果是nginx前端+apache后端
apache 不需要设置
请大家看清代码有些不要无脑照搬!
server {
listen 192.168.1.108:443;
#这里是绑定IP因为有些服务器可用多个IP地址
server_name www.cnmas.com;
root /www/web/cnmas/public_html;
index index.html index.php index.htm;
error_page 400 /errpage/400.html;
error_page 401 /errpage/401.html;
error_page 403 /errpage/403.html;
error_page 404 /errpage/404.html;
error_page 405 /errpage/405.html;
error_page 401 /errpage/500.html;
ssl on;
ssl_certificate server.crt;
#/www/wdlinux/nginx-1.0.15/conf/请上传到该目录下
ssl_certificate_key server.key;
#/www/wdlinux/nginx-1.0.15/conf/请上传到该目录下
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
fastcgi_param HTTPS on;
}
location ~ .*\.(gif|jpg|png|bmp|ico|jpeg|JPEG|JPG|GIF)$ {
expires 1h;
}
location ~ .*\.(doc|swf|flv)$ {
expires 1h;
}
location ~ .*\.(js|css)$ {
expires 1h;
}
}
server {
listen 80;
server_name www.cnmas.com;
rewrite ^/(.*) https://www.cnmas.com/$1 permanent;
#这里是强制http跳转https
}
搭个小车
http://www.cnmas.com 马鞍山贵友商贸
http://www.bale123.com芭乐剧集站
http://www.bale123.cn 芭乐123网址导航
http://www.balefx.com 芭乐淘宝返现
http://www.masidc.com马鞍山IDC
http://www.geqing.cn 芭乐科技-葛清
http://www.mastyz.com 马鞍山天佑正餐饮有限公司-十八岗特色风味馆
欢迎前来更换链接 论坛私信我就可以了
作者:
hadals
时间:
2013-10-25 23:45
我等着呢,快点发吧 大虾
作者:
374399415
时间:
2013-10-26 11:49
本帖最后由 374399415 于 2013-10-26 11:54 编辑
回复
3#
hadals
代码已上
作者:
374399415
时间:
2013-10-26 18:02
人工置顶。
作者:
374399415
时间:
2013-10-27 00:01
人工置顶。
作者:
374399415
时间:
2013-10-27 20:54
人工置顶。
作者:
hionline
时间:
2014-5-5 00:10
这个有没有用,我试一下看看
作者:
sanky
时间:
2015-5-28 00:41
yezizhiyinliao.com照楼主教程安装网页打不开原来的配置如下:server {
listen 80;
server_name yezizhiyinliao.com www.yezizhiyinliao.com;
root /www/web/yezizhiyinliao_com/public_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;
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;
}
}
作者:
cdd311
时间:
2016-12-14 18:09
可以用,但是我还有一个问题。之前的http链接,比如引用css文件,那些链接不会改变
作者:
junlee
时间:
2016-12-19 21:27
回复
10#
cdd311
是的,我开启之后,网站CSS会错乱,果断放弃
欢迎光临 WDlinux官方论坛 (http://wdlinux.cn/bbs/)
Powered by Discuz! 7.2