mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 04:39:20 +00:00
Fixing nginx configuration when server_name is not passed
This commit is contained in:
@@ -19,6 +19,7 @@ _addSslConfig() {
|
|||||||
echo "ssl_certificate ${SSL_CERTIFICATE};" >> ${FILE_CONF};
|
echo "ssl_certificate ${SSL_CERTIFICATE};" >> ${FILE_CONF};
|
||||||
echo "ssl_certificate_key ${SSL_CERTIFICATE_KEY};" >> ${FILE_CONF};
|
echo "ssl_certificate_key ${SSL_CERTIFICATE_KEY};" >> ${FILE_CONF};
|
||||||
else
|
else
|
||||||
|
echo 'listen 80;' >> ${FILE_CONF};
|
||||||
echo "ssl ${1} not found >> ${SSL_CERTIFICATE} -> ${SSL_CERTIFICATE_KEY}"
|
echo "ssl ${1} not found >> ${SSL_CERTIFICATE} -> ${SSL_CERTIFICATE_KEY}"
|
||||||
fi;
|
fi;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,27 @@
|
|||||||
|
include include.d/ssl-redirect.conf;
|
||||||
|
|
||||||
upstream backend {
|
upstream backend {
|
||||||
server {{ .Env.URL_BACKEND }};
|
server {{ .Env.URL_BACKEND }};
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
|
||||||
index index.html;
|
index index.html;
|
||||||
root /var/www/public/;
|
root /var/www/public/;
|
||||||
|
|
||||||
server_name {{ default .Env.FRONTEND_SERVER_NAME "_" }};
|
{{ if .Env.FRONTEND_SERVER_NAME }}
|
||||||
|
server_name {{ .Env.FRONTEND_SERVER_NAME }};
|
||||||
|
{{else}}
|
||||||
|
server_name _;
|
||||||
|
{{end}}
|
||||||
|
|
||||||
include sites.d/frontend.conf;
|
include sites.d/frontend.conf;
|
||||||
include include.d/letsencrypt.conf;
|
include include.d/letsencrypt.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{if .Env.BACKEND_SERVER_NAME}}
|
||||||
server {
|
server {
|
||||||
listen 80;
|
server_name {{ .Env.BACKEND_SERVER_NAME }};
|
||||||
server_name {{ default .Env.BACKEND_SERVER_NAME "_" }};
|
|
||||||
include sites.d/backend.conf;
|
include sites.d/backend.conf;
|
||||||
include include.d/letsencrypt.conf;
|
include include.d/letsencrypt.conf;
|
||||||
}
|
}
|
||||||
|
{{end}}
|
||||||
5
frontend/.docker/nginx/include.d/ssl-redirect.conf
Normal file
5
frontend/.docker/nginx/include.d/ssl-redirect.conf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
return 302 https://$host$request_uri;
|
||||||
|
}
|
||||||
@@ -8,4 +8,4 @@ location / {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_cache_bypass $http_upgrade;
|
proxy_cache_bypass $http_upgrade;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ location /static {
|
|||||||
include include.d/allcache.conf;
|
include include.d/allcache.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
include "include.d/spa.conf";
|
include "include.d/spa.conf";
|
||||||
|
|||||||
Reference in New Issue
Block a user