Skip to content

Commit

Permalink
fix: cors test28
Browse files Browse the repository at this point in the history
  • Loading branch information
toychip committed Aug 4, 2024
1 parent c03c64a commit 4f41fcd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 54 deletions.
14 changes: 6 additions & 8 deletions .platform/nginx/conf.d/elasticbeanstalk/00_application.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
server {
listen 443 ssl;
listen 80;
server_name dojo-backend-eb-env.eba-33qhzuax.ap-northeast-2.elasticbeanstalk.com;
ssl_certificate /home/ec2-user/keyset/fullchain.pem;
ssl_certificate_key /home/ec2-user/keyset/privkey.pem;

access_log /var/log/nginx/access.log main;

Expand All @@ -14,11 +12,11 @@ server {
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

location /health {
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}

location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
Expand Down
71 changes: 25 additions & 46 deletions .platform/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,51 +1,30 @@
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 200000;

events {
worker_connections 1024;
}

http {
types_hash_max_size 2048;
types_hash_bucket_size 128;

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

server_tokens off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

include conf.d/*.conf;

map $http_upgrade $connection_upgrade {
default "upgrade";
server {
listen 80;
server_name dojo-backend-eb-env.eba-33qhzuax.ap-northeast-2.elasticbeanstalk.com;

access_log /var/log/nginx/access.log main;

client_header_timeout 60;
client_body_timeout 60;
keepalive_timeout 60;
gzip off;
gzip_comp_level 4;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

location /health {
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}

server {
listen 80 default_server;
server_name dojo-backend-eb-env.eba-33qhzuax.ap-northeast-2.elasticbeanstalk.com;

location /health {
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}

location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
location / {
proxy_pass http://127.0.0.1:5000;
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;
}
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 4f41fcd

Please sign in to comment.