ubuntu – NginX WordPress SSL非www W3TC vhost配置文件问题
|
我有一个关于我的服务器块的问题,这个问题仅适用于运行https的WordPress网站,具有nginx和W3TC浏览器缓存. 环境:
我的问题如下: >“位置”部分的顺序是否重要? 虚拟主机配置:
server {
server_name www.domain.com;
rewrite ^(.*) https://domain.com$1 permanent;
}
server {
listen 443 default_server;
server_name domain.com;
root /usr/share/nginx/html/domain.com;
index index.php index.html index.htm;
# BEGIN W3TC Browser Cache
gzip on;
gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
# END W3TC Browser Cache
ssl on;
ssl_certificate /etc/ssl/certs/domain.com.rapidssl.crt;
ssl_certificate_key /etc/ssl/private/domain.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ .php${
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
最佳答案
请不要将多个问题合二为一.
第一步,当你不知道某些东西是如何工作的时候,就是搜索文档.在nginx的情况下,通过official documentation directive index详尽地解释了指令. >这取决于位置块性质.前缀位置块顺序并不重要,但正则表达式位置块顺序是,因为匹配请求URI的第一个将被选中. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- python – Django Admin FORCE_SCRIPT_NAME登录重
- nginx中的动态proxy_pass到Kubernetes中的另一个
- 别名使用Nginx导致phpMyAdmin登录无限循环
- ruby-on-rails – 错误乘客没有看到环境变量?
- php – 失败(104:由同行重置连接)
- nginx django 502坏网关
- 模块 – Nginx gzip过滤器无法使用我的自定义处理
- 通过SSL使用nginx的PHP websockets
- nginx vs lighttpd for wordpress
- ruby-on-rails – Rails 4 nginx unicorn ssl =
