1- user nginx;
21worker_processes auto;
3- error_log /var/log/nginx/error.log warn;
4- pid /var/run/nginx.pid ;
2+ error_log /var/log/nginx/error.log;
3+
4+ pid /tmp/nginx.pid ;
55
66events {
7- worker_connections 1024 ;
7+ worker_connections 4096 ;
88}
99
1010http {
11- include /etc/nginx/mime.types ;
12- default_type application/octet-stream ;
11+ include /etc/nginx/mime.types ;
12+ client_body_temp_path /tmp/client_temp;
13+ proxy_temp_path /tmp/proxy_temp_path ;
14+ fastcgi_temp_path /tmp/fastcgi_temp;
15+ uwsgi_temp_path /tmp/uwsgi_temp;
16+ scgi_temp_path /tmp/scgi_temp;
17+ default_type application/octet-stream ;
18+ server_tokens off;
19+ underscores_in_headers on;
20+
21+ # Use a w3c standard log format
22+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
23+ '$status $body_bytes_sent "$http_referer" '
24+ '"$http_user_agent" "$http_x_forwarded_for"' ;
25+
26+ access_log /var/log/nginx/access.log main;
27+
28+ # Enable gzip compression for better performance
29+ gzip on;
30+ gzip_disable "msie6" ;
31+ gzip_vary on;
32+ gzip_proxied any;
33+ gzip_comp_level 6;
34+ gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
35+
36+ server {
37+ # add in most common security headers
38+ add_header Content-Security-Policy "default-src * data: blob: filesystem: 'unsafe-inline' 'unsafe-eval'" ;
39+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" ;
40+ add_header X-Content-Type-Options "nosniff" ;
41+ add_header X-XSS-Protection 1;
42+ add_header X-Frame-Options SAMEORIGIN;
43+
44+ listen 8080 ;
45+ server_name _;
46+
47+ index index .html;
48+ error_log /dev/stdout info;
49+ access_log /dev/stdout;
50+
51+ # Serve versioned static files
52+ location ~ ^/forms-flow-.*@.*/.*$ {
53+ root /usr/share/nginx/html;
54+ try_files $uri =404 ;
55+ # Add cache headers for better performance
56+ expires 1d ;
57+ add_header Cache-Control "public" ;
58+ }
59+
60+ # Main application entry
61+ location / {
62+ root /usr/share/nginx/html;
63+ index index .html index .htm;
64+ try_files $uri $uri / /index .html;
65+ }
1366
14- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
15- '$status $body_bytes_sent "$http_referer" '
16- '"$http_user_agent" "$http_x_forwarded_for"' ;
67+ # Version information endpoint
68+ location = /version {
69+ alias /usr/share/nginx/html/VERSION;
70+ default_type text/plain;
71+ }
1772
18- access_log /var/log/nginx/access.log main ;
73+ error_page 500 502 503 504 / 50x .html ;
1974
20- sendfile on;
21- tcp_nopush on;
22- tcp_nodelay on;
23- keepalive_timeout 65 ;
24- types_hash_max_size 2048 ;
25- client_max_body_size 20M ;
26-
27- # Enable gzip compression
28- gzip on;
29- gzip_vary on;
30- gzip_proxied any;
31- gzip_comp_level 6;
32- gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
33-
34- # Microfrontends setup
35- server {
36- listen 80 ;
37- server_name localhost;
38-
39- # Root directory for the application
40- root /usr/share/nginx/html;
41-
42- # Serve static files
43- location / {
44- try_files $uri $uri / /index .html;
45- }
46-
47- # Define locations for each microfrontend
48- location /forms-flow-admin/ {
49- alias /usr/share/nginx/html/forms-flow-admin/;
50- try_files $uri $uri / /forms-flow-admin/index .html;
51- }
52-
53- location /forms-flow-components/ {
54- alias /usr/share/nginx/html/forms-flow-components/;
55- try_files $uri $uri / /forms-flow-components/index .html;
56- }
57-
58- location /forms-flow-integration/ {
59- alias /usr/share/nginx/html/forms-flow-integration/;
60- try_files $uri $uri / /forms-flow-integration/index .html;
61- }
62-
63- location /forms-flow-nav/ {
64- alias /usr/share/nginx/html/forms-flow-nav/;
65- try_files $uri $uri / /forms-flow-nav/index .html;
66- }
67-
68- location /forms-flow-rsbcservice/ {
69- alias /usr/share/nginx/html/forms-flow-rsbcservice/;
70- try_files $uri $uri / /forms-flow-rsbcservice/index .html;
71- }
72-
73- location /forms-flow-service/ {
74- alias /usr/share/nginx/html/forms-flow-service/;
75- try_files $uri $uri / /forms-flow-service/index .html;
76- }
77-
78- location /forms-flow-theme/ {
79- alias /usr/share/nginx/html/forms-flow-theme/;
80- try_files $uri $uri / /forms-flow-theme/index .html;
81- }
82-
83- # Add cache control for static assets
84- location ~ * \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
85- expires 30d ;
86- add_header Cache-Control "public, no-transform" ;
87- }
88-
89- # Health check endpoint
90- location /health {
91- access_log off;
92- return 200 'OK' ;
93- add_header Content-Type text/plain;
94- }
95- }
75+ location = /50x .html {
76+ root /usr/share/nginx/html;
77+ }
78+ }
9679}
0 commit comments