|
# /etc/nginx/sites-available/genieacs.conf |
|
# Nginx configuration for genieacs services |
|
# Ensure you change the listening IP address |
|
# If you're allergic to security, you can remove the `add_header` |
|
# lines without breaking functionality |
|
|
|
upstream genieacs-gui { |
|
server 127.0.0.1:8080; |
|
} |
|
|
|
upstream genieacs-cwmp { |
|
server 127.0.0.1:7547; |
|
} |
|
|
|
upstream genieacs-nbi { |
|
server 127.0.0.1:7557; |
|
} |
|
|
|
upstream genieacs-fs { |
|
server 127.0.0.1:7567; |
|
} |
|
|
|
server { |
|
listen 80 default_server; |
|
server_name web.acs.test.local acs.test.local; |
|
|
|
add_header Content-Security-Policy "default-src 'self'" always; |
|
add_header Referrer-Policy "no-referrer" always; |
|
add_header X-Content-Type-Options "nosniff" always; |
|
add_header X-Frame-Options "sameorigin" always; |
|
add_header X-XSS-Protection "1; mode block" always; |
|
|
|
return 301 https://$server_name$request_uri; |
|
} |
|
|
|
server { |
|
listen 443 ssl http2; |
|
server_name web.acs.test.local acs.test.local; |
|
|
|
ssl_certificate_key /opt/genieacs/config/web.key; |
|
ssl_certificate /opt/genieacs/config/web.crt; |
|
|
|
access_log /var/log/nginx/genieacs-web-access.log combined; |
|
error_log /var/log/nginx/genieacs-web-error.log; |
|
|
|
client_max_body_size 50M; |
|
|
|
root /opt/genieacs-gui/public; |
|
try_files $uri $uri/index.html @app; |
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
|
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'" always; |
|
add_header Referrer-Policy "no-referrer" always; |
|
add_header X-Content-Type-Options "nosniff" always; |
|
add_header X-Frame-Options "sameorigin" always; |
|
add_header X-XSS-Protection "1; mode block" always; |
|
|
|
location @app { |
|
proxy_pass http://genieacs-gui; |
|
proxy_http_version 1.1; |
|
proxy_set_header Upgrade $http_upgrade; |
|
proxy_set_header Connection 'upgrade'; |
|
proxy_set_header Host $host; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
proxy_cache_bypass $http_upgrade; |
|
proxy_redirect off; |
|
} |
|
} |
|
|
|
server { |
|
listen 192.168.1.10:7547 ssl; |
|
server_name cwmp.acs.test.local acs.test.local; |
|
|
|
ssl_certificate_key /opt/genieacs/config/cwmp.key; |
|
ssl_certificate /opt/genieacs/config/cwmp.crt; |
|
|
|
access_log /var/log/nginx/genieacs-cwmp-access.log combined; |
|
error_log /var/log/nginx/genieacs-cwmp-error.log; |
|
|
|
client_max_body_size 50M; |
|
|
|
add_header Strict-Transport-Security "max-age=31536000" always; |
|
add_header Content-Security-Policy "default-src 'self'" always; |
|
add_header Referrer-Policy "no-referrer" always; |
|
add_header X-Content-Type-Options "nosniff" always; |
|
add_header X-Frame-Options "sameorigin" always; |
|
add_header X-XSS-Protection "1; mode block" always; |
|
|
|
location / { |
|
proxy_pass http://genieacs-cwmp; |
|
proxy_http_version 1.1; |
|
proxy_set_header Upgrade $http_upgrade; |
|
proxy_set_header Connection 'upgrade'; |
|
proxy_set_header Host $host; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
proxy_cache_bypass $http_upgrade; |
|
proxy_set_header Authorization ""; |
|
auth_basic "Restricted"; |
|
auth_basic_user_file /etc/nginx/ms-htpasswd; |
|
} |
|
} |
|
|
|
server { |
|
listen 192.168.1.10:7557 ssl; |
|
server_name nbi.acs.test.local acs.test.local; |
|
|
|
ssl_certificate_key /opt/genieacs/config/nbi.key; |
|
ssl_certificate /opt/genieacs/config/nbi.crt; |
|
|
|
access_log /var/log/nginx/genieacs-nbi-access.log combined; |
|
error_log /var/log/nginx/genieacs-nbi-error.log; |
|
|
|
client_max_body_size 50M; |
|
|
|
add_header Strict-Transport-Security "max-age=31536000" always; |
|
add_header Content-Security-Policy "default-src 'self'" always; |
|
add_header Referrer-Policy "no-referrer" always; |
|
add_header X-Content-Type-Options "nosniff" always; |
|
add_header X-Frame-Options "sameorigin" always; |
|
add_header X-XSS-Protection "1; mode block" always; |
|
|
|
location / { |
|
proxy_pass http://genieacs-nbi; |
|
proxy_http_version 1.1; |
|
proxy_set_header Upgrade $http_upgrade; |
|
proxy_set_header Connection 'upgrade'; |
|
proxy_set_header Host $host; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
proxy_cache_bypass $http_upgrade; |
|
proxy_set_header Authorization ""; |
|
auth_basic "Restricted"; |
|
auth_basic_user_file /etc/nginx/ms-htpasswd; |
|
} |
|
} |
|
|
|
server { |
|
listen 192.168.1.10:7567 ssl; |
|
server_name fs.acs.test.local acs.test.local; |
|
|
|
ssl_certificate_key /opt/genieacs/config/fs.key; |
|
ssl_certificate /opt/genieacs/config/fs.crt; |
|
|
|
access_log /var/log/nginx/genieacs-fs-access.log combined; |
|
error_log /var/log/nginx/genieacs-fs-error.log; |
|
|
|
client_max_body_size 50M; |
|
|
|
add_header Strict-Transport-Security "max-age=31536000" always; |
|
add_header Content-Security-Policy "default-src 'self'" always; |
|
add_header Referrer-Policy "no-referrer" always; |
|
add_header X-Content-Type-Options "nosniff" always; |
|
add_header X-Frame-Options "sameorigin" always; |
|
add_header X-XSS-Protection "1; mode block" always; |
|
|
|
location / { |
|
proxy_pass http://genieacs-fs; |
|
proxy_http_version 1.1; |
|
proxy_set_header Upgrade $http_upgrade; |
|
proxy_set_header Connection 'upgrade'; |
|
proxy_set_header Host $host; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
proxy_cache_bypass $http_upgrade; |
|
proxy_set_header Authorization ""; |
|
auth_basic "Restricted"; |
|
auth_basic_user_file /etc/nginx/ms-htpasswd; |
|
} |
|
} |