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的第一个将被选中. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 适用于Magento的Nginx PHP-FPM FastCGI缓存配置
- nginx – 在同一台服务器上升级2个Ghost博客,1作为服务运行
- Nginx在vhost和SSL之间发出问题
- 在使用Nginx设置SSL时遇到问题
- python – X-Forwarded-Proto和Flask
- node.js-NGINX:使用域/路径在同一服务器上的多个节点js应用
- IIS?Lockdown?工具如何处理应用程序映射?
- nginx – 根据同一vhost中访问的主机名自动选择SSL证书
- 在debian(基于系统)上配置git-http-backend的nginx
- Nginx 做为代理服务器注意文件上传配置这块参数。否则会出现