Skip to content

Commit

Permalink
updated ngnix
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthi-aot committed Mar 13, 2024
1 parent 04e4080 commit b597114
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 58 deletions.
2 changes: 1 addition & 1 deletion app/caseflow_web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ RUN npm run build
FROM nginx:latest as production-stage
RUN mkdir /app
COPY --from=build-stage /case-flow-web/app/build /usr/share/nginx/html
COPY ./nginx_conf/nginx.conf /etc/nginx/nginx.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
82 changes: 25 additions & 57 deletions app/caseflow_web/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,61 +1,29 @@
# nginx.conf
worker_processes auto;
error_log /var/log/nginx/error.log;

pid /tmp/nginx.pid;


user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 4096;
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
default_type application/octet-stream;
server_tokens off;
underscores_in_headers on;

# Use a w3c standard log format
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

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


server {

# add in most common security headers
add_header Content-Security-Policy "default-src * data: blob: filesystem: 'unsafe-inline' 'unsafe-eval'";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection 1;
add_header X-Frame-Options SAMEORIGIN;



listen 8080;
server_name _;

index index.html;
error_log /dev/stdout info;
access_log /dev/stdout;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /usr/share/nginx/html;
}
}
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"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;

keepalive_timeout 65;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
}

0 comments on commit b597114

Please sign in to comment.