Skip to content

Commit

Permalink
fix: cors test18
Browse files Browse the repository at this point in the history
  • Loading branch information
toychip committed Aug 3, 2024
1 parent 0a43097 commit 7a962e8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
18 changes: 18 additions & 0 deletions .platform/nginx/conf.d/elasticbeanstalk/00_application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
server {
listen 443 ssl;
server_name dojo-backend-eb-env.eba-33qhzuax.ap-northeast-2.elasticbeanstalk.com;

ssl_certificate /etc/letsencrypt/live/dojo-backend-eb-env.eba-33qhzuax.ap-northeast-2.elasticbeanstalk.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dojo-backend-eb-env.eba-33qhzuax.ap-northeast-2.elasticbeanstalk.com/privkey.pem;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;

proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
3 changes: 3 additions & 0 deletions .platform/nginx/conf.d/healthd_logformat.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
20 changes: 3 additions & 17 deletions .platform/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# .platform/nginx/nginx.conf

user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
Expand All @@ -14,12 +16,7 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

types_hash_max_size 2048;
types_hash_bucket_size 128;


include conf.d/*.conf;

Expand Down Expand Up @@ -51,16 +48,5 @@ http {

# Include the Elastic Beanstalk generated locations
include /var/proxy/staging/nginx/conf.d/*.conf;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;

proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}

0 comments on commit 7a962e8

Please sign in to comment.