From 84917c1e1b69797c94bfb3407f0dbe2b0f499e6a Mon Sep 17 00:00:00 2001 From: Yuri-Lima Date: Thu, 24 Aug 2023 17:25:47 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20REFACTOR:=20Ngix=20Renamed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/nginx.conf | 202 +++++++++++++++++++++++------------------------ 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 73a6f5d..9e15532 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -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-backend: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-backend: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-backend: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-backend: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-backend: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-backend: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-backend: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-backend: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-backend: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-backend:3000/graphql; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } -# } + } -# } \ No newline at end of file +} \ No newline at end of file