Skip to content

Commit

Permalink
Merge pull request #136 from maticnetwork/DEVOPS-2599-cors-issue-update
Browse files Browse the repository at this point in the history
Update for nginx
  • Loading branch information
sshrihar authored Apr 5, 2024
2 parents 0c8366b + 421b3d1 commit 21d3524
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM nginx:alpine

COPY nginx.conf /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf

WORKDIR /usr/share/nginx/html
COPY . .
Expand Down
39 changes: 12 additions & 27 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
# nginx.conf
server {
listen 0.0.0.0:80;
root /usr/share/nginx/html;
index index.html;
error_page 404 /404.html;
location / {
try_files $uri.html $uri $uri/ /index.html;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials false;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Methods GET, POST, OPTIONS;
add_header Access-Control-Expose-Headers *;

user nginx;
worker_processes 1;

events {
worker_connections 1024;
}

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

sendfile on;
keepalive_timeout 65;

server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials false;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Methods GET, POST, OPTIONS;
add_header Access-Control-Expose-Headers *;

}
}
}

0 comments on commit 21d3524

Please sign in to comment.