这个配置有问题吗?会不会影响SEO权重,我这样配置了,百度站长工具里检测robots.txt提示301配置有误,但是打开都正常 打开不带www可以成功转到带www,打开不带http可以成功转到https
- #这是反代服务器的配置
- server {
- listen 80;
- server_name example.com www.example.com;
- return 301 https://www.example.com$request_uri;
- }
-
- server {
- listen 443;
- server_name example.com;
- ssl_certificate /data/ssl/www.example.com.crt;
- ssl_certificate_key /data/ssl/www.example.com.key;
- return 301 https://www.example.com$request_uri;
- }
-
- server {
- listen 443 ssl http2;
- server_name www.example.com;
- ssl_certificate /data/ssl/www.example.com.crt;
- ssl_certificate_key /data/ssl/www.example.com.key;
- ssl_session_timeout 10m;
- location = / {
- …
- }
复制代码
- #这是源站服务器的配置
- server {
- listen 80;
- server_name example.com www.example.com;
- return 301 https://www.example.com$request_uri;
- }
-
- server {
- listen 443;
- server_name example.com;
- ssl_certificate /usr/local/nginx/conf/ssl/www.example.com.crt;
- ssl_certificate_key /usr/local/nginx/conf/ssl/www.example.com.key;
- return 301 https://www.example.com$request_uri;
- }
-
- server {
- #listen 80;
- listen 443 ssl http2;
- server_name www.example.com;
- root /data/wwwroot/www.example.com;
- index index.html index.htm index.php;
- access_log /data/wwwlogs/www.example.com_nginx.log combined;
- location = / {
- …
-
- }
复制代码
⠀ |