Skip to content

Commit 2a65755

Browse files
committed
Update port configuration and Nginx settings
1 parent aac9de8 commit 2a65755

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
option_settings:
22
aws:elasticbeanstalk:container:python:
33
WSGIPath: application:application
4+
aws:elasticbeanstalk:application:environment:
5+
PORT: 8000
6+
aws:elasticbeanstalk:environment:proxy:
7+
ProxyServer: nginx
8+
aws:elasticbeanstalk:environment:process:default:
9+
Port: 8000
10+
Protocol: HTTP
11+
12+
files:
13+
"/etc/nginx/conf.d/proxy.conf":
14+
mode: "000644"
15+
owner: root
16+
group: root
17+
content: |
18+
upstream backend {
19+
server 127.0.0.1:8000;
20+
}
21+
22+
server {
23+
listen 80;
24+
25+
location / {
26+
proxy_pass http://backend;
27+
proxy_set_header Host $host;
28+
proxy_set_header X-Real-IP $remote_addr;
29+
30+
if ($request_method = 'OPTIONS') {
31+
add_header 'Access-Control-Allow-Origin' '*';
32+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
33+
add_header 'Access-Control-Allow-Headers' '*';
34+
add_header 'Content-Type' 'text/plain charset=UTF-8';
35+
add_header 'Content-Length' 0;
36+
return 204;
37+
}
38+
39+
add_header 'Access-Control-Allow-Origin' '*' always;
40+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
41+
add_header 'Access-Control-Allow-Headers' '*' always;
42+
}
43+
}

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: gunicorn application:application --bind 0.0.0.0:80 -k uvicorn.workers.UvicornWorker
1+
web: gunicorn application:application --bind 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker

0 commit comments

Comments
 (0)