■ ■ ■ ■ ■ ■
.platform/nginx/conf.d/elasticbeanstalk/00_application.conf
| 1 | + | location / { |
| 2 | + | # Base config from elasticbeanstalk: |
| 3 | + | proxy_pass http://127.0.0.1:8080; |
| 4 | + | proxy_http_version 1.1; |
| 5 | + | |
| 6 | + | proxy_set_header Connection $connection_upgrade; |
| 7 | + | proxy_set_header Upgrade $http_upgrade; |
| 8 | + | proxy_set_header Host $host; |
| 9 | + | proxy_set_header X-Real-IP $remote_addr; |
| 10 | + | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 11 | + | |
| 12 | + | # Add forwarded protocol and port details |
| 13 | + | proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; |
| 14 | + | proxy_set_header X-Forwarded-Port $http_x_forwarded_port; |
| 15 | + | |
| 16 | + | # Override gzip directive in server block |
| 17 | + | gzip on; |
| 18 | + | gzip_comp_level 5; |
| 19 | + | gzip_types text/* application/json application/javascript application/x-javascript application/xml application/xml+rss; |
| 20 | + | } |
| 21 | + | |
| 22 | + | |