Tweaking nginx and env vars
This commit is contained in:
9
.env
9
.env
@@ -5,9 +5,8 @@ NGINX_SSL_ENABLED=false
|
||||
NGINX_PROTOCOL=http
|
||||
NGINX_HTTP_PORT=8080
|
||||
NGINX_HTTPS_PORT=8443
|
||||
NGINX_MINIO_HOST=host.docker.internal
|
||||
NGINX_API_HOST=host.docker.internal
|
||||
NGINX_UI_HOST=host.docker.internal
|
||||
# Set to 'localhost' or 'host.docker.internal' or '172.17.0.1'
|
||||
NGINX_INTERNAL_HOST=host.docker.internal
|
||||
|
||||
POSTGRES_HOST=localhost
|
||||
POSTGRES_USER=aviation
|
||||
@@ -27,11 +26,7 @@ MINIO_PORT=9000
|
||||
MINIO_PORT_INTERNAL=9001
|
||||
MINIO_BROWSER_REDIRECT_URL=${NGINX_PROTOCOL}://${NGINX_HOST}:${NGINX_HTTPS_PORT}/minio/
|
||||
|
||||
UI_PROTOCOL=http
|
||||
UI_PORT=3000
|
||||
|
||||
API_PROTOCOL=http
|
||||
API_HOST=0.0.0.0
|
||||
API_PORT=5000
|
||||
|
||||
SSL_CA_NAME=ca
|
||||
|
||||
@@ -70,7 +70,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.expect("Failed to create reqwest client");
|
||||
|
||||
let state = AppState { client };
|
||||
let host = env::var("API_HOST").unwrap_or("localhost".to_string());
|
||||
let host = "0.0.0.0";
|
||||
let port = env::var("API_PORT").unwrap_or("5000".to_string());
|
||||
|
||||
let server = match HttpServer::new(move || {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
vars {
|
||||
BASE_URL: https://localhost:8443
|
||||
~BASE_URL: https://localhost:8443
|
||||
BASE_URL: http://localhost:8080
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
env_file: *env
|
||||
environment:
|
||||
API_HOST: 0.0.0.0
|
||||
SSL_CA_PATH: /ssl/ca.pem
|
||||
POSTGRES_HOST: aviation-postgres
|
||||
POSTGRES_PORT: 5432
|
||||
|
||||
@@ -5,7 +5,7 @@ server {
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
location /api/ {
|
||||
proxy_pass ${API_PROTOCOL}://${NGINX_API_HOST}:${API_PORT}/api/;
|
||||
proxy_pass http://${NGINX_INTERNAL_HOST}:${API_PORT}/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -13,7 +13,7 @@ server {
|
||||
}
|
||||
|
||||
location /minio/ {
|
||||
proxy_pass ${MINIO_PROTOCOL}://${NGINX_MINIO_HOST}:${MINIO_PORT_INTERNAL}/;
|
||||
proxy_pass http://${NGINX_INTERNAL_HOST}:${MINIO_PORT_INTERNAL}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -22,7 +22,7 @@ server {
|
||||
|
||||
# Reverse proxy for the UI and default catch-all
|
||||
location / {
|
||||
proxy_pass ${UI_PROTOCOL}://${NGINX_UI_HOST}:${UI_PORT}/;
|
||||
proxy_pass http://${NGINX_INTERNAL_HOST}:${UI_PORT}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -25,7 +25,7 @@ server {
|
||||
# ssl_prefer_server_ciphers on;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass ${API_PROTOCOL}://${NGINX_API_HOST}:${API_PORT}/api/;
|
||||
proxy_pass http://${NGINX_INTERNAL_HOST}:${API_PORT}/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -33,7 +33,7 @@ server {
|
||||
}
|
||||
|
||||
location /minio/ {
|
||||
proxy_pass ${MINIO_PROTOCOL}://${NGINX_MINIO_HOST}:${MINIO_PORT_INTERNAL}/;
|
||||
proxy_pass http://${NGINX_INTERNAL_HOST}:${MINIO_PORT_INTERNAL}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -42,7 +42,7 @@ server {
|
||||
|
||||
# Reverse proxy for the UI and default catch-all
|
||||
location / {
|
||||
proxy_pass ${UI_PROTOCOL}://${NGINX_UI_HOST}:${UI_PORT}/;
|
||||
proxy_pass http://${NGINX_INTERNAL_HOST}:${UI_PORT}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user