
오늘 내 사이트의 두 디렉토리에 대해 SSL을 활성화하려고 노력했지만 지금까지 성공하지 못했습니다. 나는 serverfault에서 여기에 표시된 몇 가지 수정 사항을 시도했지만 아무 것도 작동하지 못했습니다. 사이트의 레이아웃은 다음과 같습니다.
- examplesite.com은 표준 WordPress 사이트입니다.
- examplesite.com/shop은 메인 examplesite.com 설치의 일부로 실행되는 WordPress용 플러그인인 MarketPress 상점입니다.
- examplesite.com/classifieds는 별도의 WordPress 설치입니다.
examplesite.com/shop 및 examplesite.com/classifieds에 대해 SSL을 켜야 하는데 지금까지 구성을 제대로 맞춤화할 수 없었습니다.
누구든지 이것을 구성하는 더 좋은 방법이나 아래 구성에 대한 수정 사항이 있다면 감사하겠습니다.
server {
server_name xamplesite.com www.examplesite.com;
listen 80;
server_tokens off;
access_log /home/nginx/domains/examplesite.comv/log/access.log combined buffer=32k;
error_log /home/nginx/domains/examplesite.com/log/error.log;
root /home/nginx/domains/examplesite.com/public;
location /shop {
rewrite ^ https://$host$request_uri permanent;
}
location /classifieds {
rewrite ^ https://$host$request_uri permanent;
}
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/drop.conf;
include /usr/local/nginx/conf/block.conf;
include /usr/local/nginx/conf/wordpress/restrictions.conf;
include /usr/local/nginx/conf/wordpress/wordpress.conf;
}
server {
listen 443;
server_name 127.0.0.1;
access_log /home/nginx/domains/examplesite.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/examplesite.com/log/error.log;
root /home/nginx/domains/examplesite.com/public;
ssl on;
ssl_certificate /etc/ssl/certs/example.crt;
ssl_certificate_key /etc/ssl/private/example.key;
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 /shop {
try_files $uri $uri/ /index.php?$args;
}
location /classifieds {
try_files $uri $uri/ /index.php?$args;
}
location / {
rewrite ^ http://$host$request_uri permanent;
}
}
답변1
listen 443;
로 변경해 보세요 listen 443 ssl;
.