AMH 社区首页
AMH社区 - 开放自由有价值的社区
[求助帖] 想把所有的80端口及abc.org都自动转到https://www.abc.org怎么做... |
|
---|---|
一品小地主 |
一品小地主 发表于 2015-05-22 10:14:23
求科普、求指导 我的ssl绑定后www可以访问但abc.org不能访问
另外我想把所有的80端口及abc.org都自动转到https://www.abc.org怎么做?谢谢 server
{ listen 80; server_name abc.org www.abc.org; #server_name end index index.html index.htm index.php; #index end #------80 301 443 if ($server_port = 80) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } error_page 497 https://$server_name$request_uri; #------80 301 443 #------SSL BEGIN listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/ssl/abc.org.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/abc.org.pem; #------SSL END set $subdomain ''; root /home/wwwroot/abc.org/web$subdomain; include rewrite/amh.conf; #rewrite end #error_page error_page 400 /ErrorPages/400.html; error_page 403 /ErrorPages/403.html; error_page 404 /ErrorPages/404.html; error_page 502 /ErrorPages/502.html; location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$ { root /home/wwwroot/abc.org/web; } location ~ .*\.php$ { fastcgi_pass unix:/tmp/php-cgi-abc.org.sock; fastcgi_index index.php; include fcgi-host.conf; fastcgi_param DOCUMENT_ROOT /web$subdomain; fastcgi_param SCRIPT_FILENAME /web$subdomain$fastcgi_script_name; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$ { expires 30d; } location ~ .*\.(js|css)$ { expires 12h; } access_log off; #access_log end error_log /dev/null; #error_log end }
点赞,加油! (0分)
2015-05-22 10:14:23 1
|