👌 REFACOT: ngix reseted

This commit is contained in:
Yuri-Lima
2023-08-24 17:16:13 +00:00
parent 925ef569ad
commit 99d4d8bfe9
2 changed files with 102 additions and 102 deletions

View File

@@ -12,7 +12,7 @@ services:
- "/opt/containers/phx/app_custom:/usr/share/nginx/html/assets/custom"
- "/opt/containers/phx/nginx/nginx.conf:/etc/nginx/nginx.conf"
ports:
- "8081:80"
- "8083:80"
# - "443:443"
networks:
- frontend

View File

@@ -1,126 +1,126 @@
worker_processes 1;
# worker_processes 1;
events {
worker_connections 1024;
}
# events {
# worker_connections 1024;
# }
http {
# http {
sendfile on;
client_max_body_size 64m;
#client_body_temp_path /data/temp;
# sendfile on;
# client_max_body_size 64m;
# #client_body_temp_path /data/temp;
server {
listen 80;
server_name localhost;
# server {
# listen 80;
# server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;
# root /usr/share/nginx/html;
# index index.html index.htm;
# include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# gzip on;
# gzip_min_length 1000;
# gzip_proxied expired no-cache no-store private auth;
# gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
sendfile on;
client_max_body_size 64m;
# sendfile on;
# client_max_body_size 64m;
location / {
try_files $uri $uri/ /index.html;
}
# https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite
location /backend-api/ {
#rewrite ^/backend-api(.*) /$1 break;
proxy_pass http://phoenix-system:3000/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# location / {
# try_files $uri $uri/ /index.html;
# }
# # https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite
# location /backend-api/ {
# #rewrite ^/backend-api(.*) /$1 break;
# proxy_pass http://phoenix-system:3000/;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# }
location /admin-api {
proxy_pass http://phoenix-system:3000/admin-api;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# location /admin-api {
# proxy_pass http://phoenix-system:3000/admin-api;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# }
location /remote-assets {
proxy_pass http://phoenix-system:3000/remote-assets;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# location /remote-assets {
# proxy_pass http://phoenix-system:3000/remote-assets;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# }
location /sti {
proxy_pass http://phoenix-system:3000/sti;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# location /sti {
# proxy_pass http://phoenix-system:3000/sti;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# }
location /ws {
proxy_pass http://phoenix-system:3000/graphql;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# location /ws {
# proxy_pass http://phoenix-system:3000/graphql;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# }
# }
server { # This new server will watch for traffic on 443
listen 443 ssl http2;
server_name localhost;
ssl_certificate /etc/nginx/external-certificate/certificate.crt;
ssl_certificate_key /etc/nginx/external-certificate/certificate.key;
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;
# server { # This new server will watch for traffic on 443
# listen 443 ssl http2;
# server_name localhost;
# ssl_certificate /etc/nginx/external-certificate/certificate.crt;
# ssl_certificate_key /etc/nginx/external-certificate/certificate.key;
# root /usr/share/nginx/html;
# index index.html index.htm;
# include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# gzip on;
# gzip_min_length 1000;
# gzip_proxied expired no-cache no-store private auth;
# gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
sendfile on;
client_max_body_size 64m;
# sendfile on;
# client_max_body_size 64m;
location / {
try_files $uri $uri/ /index.html;
}
# location / {
# try_files $uri $uri/ /index.html;
# }
# https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite
location /backend-api/ {
#rewrite ^/backend-api(.*) /$1 break;
proxy_pass http://phoenix-system:3000/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
}
# # https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite
# location /backend-api/ {
# #rewrite ^/backend-api(.*) /$1 break;
# proxy_pass http://phoenix-system:3000/;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto https;
# }
location /admin-api {
proxy_pass http://phoenix-system:3000/admin-api;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# location /admin-api {
# proxy_pass http://phoenix-system:3000/admin-api;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# }
location /remote-assets {
proxy_pass http://phoenix-system:3000/remote-assets;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
}
# location /remote-assets {
# proxy_pass http://phoenix-system:3000/remote-assets;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto https;
# }
location /sti {
proxy_pass http://phoenix-system:3000/sti;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# location /sti {
# proxy_pass http://phoenix-system:3000/sti;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# }
location /ws {
proxy_pass http://phoenix-system:3000/graphql;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# location /ws {
# proxy_pass http://phoenix-system:3000/graphql;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# }
}
# }
}
# }