Add www redirect for goosefarminvesting
Some checks are pending
Deploy Nginx Config to Ubuntu Server / deploy (push) Waiting to run

This commit is contained in:
happybell80 2026-03-11 21:06:31 +09:00
parent c8f2b32d45
commit 007b9c0b63

View File

@ -432,12 +432,16 @@ server {
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name goosefarminvesting.com; server_name goosefarminvesting.com www.goosefarminvesting.com;
location /.well-known/acme-challenge/ { location /.well-known/acme-challenge/ {
alias /var/www/html/.well-known/acme-challenge/; alias /var/www/html/.well-known/acme-challenge/;
} }
if ($host = www.goosefarminvesting.com) {
return 301 https://goosefarminvesting.com$request_uri;
}
location = / { location = / {
return 301 https://$host/goosefarm/; return 301 https://$host/goosefarm/;
} }
@ -450,13 +454,17 @@ server {
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name goosefarminvesting.com; server_name goosefarminvesting.com www.goosefarminvesting.com;
ssl_certificate /etc/letsencrypt/live/goosefarminvesting.com/fullchain.pem; ssl_certificate /etc/letsencrypt/live/goosefarminvesting.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/goosefarminvesting.com/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/goosefarminvesting.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
if ($host = www.goosefarminvesting.com) {
return 301 https://goosefarminvesting.com$request_uri;
}
location = / { location = / {
return 301 https://$host/goosefarm/; return 301 https://$host/goosefarm/;
} }