File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ files:
2+ "/etc/nginx/conf.d/proxy.conf":
3+ mode: "000644"
4+ owner: root
5+ group: root
6+ content: |
7+ server {
8+ listen 80;
9+ server_name localhost;
10+
11+ location / {
12+ proxy_pass http://127.0.0.1:5000;
13+ proxy_set_header Host $host;
14+ proxy_set_header X-Real-IP $remote_addr;
15+
16+ # CORS configuration
17+ if ($request_method = 'OPTIONS') {
18+ add_header 'Access-Control-Allow-Origin' '*';
19+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
20+ add_header 'Access-Control-Allow-Headers' '*';
21+ add_header 'Access-Control-Max-Age' 1728000;
22+ add_header 'Content-Type' 'text/plain charset=UTF-8';
23+ add_header 'Content-Length' 0;
24+ return 204;
25+ }
26+ add_header 'Access-Control-Allow-Origin' '*' always;
27+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
28+ add_header 'Access-Control-Allow-Headers' '*' always;
29+ }
30+ }
31+
32+ container_commands:
33+ 01_reload_nginx:
34+ command: "service nginx reload"
You can’t perform that action at this time.
0 commit comments