BE/AWS
[ AWS ] ElasticBeanstalk www Redirect
HEON.D
2024. 1. 4. 16:32
.ebextensions
01-configure-nginx.config
files:
"/etc/nginx/conf.d/custom.conf":
mode: "000755"
owner: root
group: root
content: |
server {
listen 80;
server_name alicerabbi.team;
# Redirect to www.alicerabbit.team
return 301 $scheme://www.alicerabbit.team$request_uri;
}
server {
listen 80;
server_name www.alicerabbit.team;
location / {
proxy_pass http://alice-web-prod-env.ap-northeast-2.elasticbeanstalk.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}