diff --git a/docker-compose.yml b/docker-compose.yml index 3ca9fa8..17d377b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -106,3 +106,13 @@ services: # volumes: # db_data: # fa_config: + + # proxy: + # image: nginx:latest + # container_name: nginx-proxy + # restart: unless-stopped + # ports: + # - 80:80 + # - 443:443 + # volumes: + # - ./proxy-default.conf:/etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/next.config.js b/next.config.js index ae88795..e6fc134 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,12 @@ /** @type {import('next').NextConfig} */ + +const isProd = process.env.NODE_ENV === 'production' + const nextConfig = { reactStrictMode: true, swcMinify: true, + // "/admin" is the path we would use in the reverse proxy, so change accordingly if you want to use some other path + assetPrefix: isProd ? '/admin' : undefined, } module.exports = nextConfig diff --git a/proxy-default.conf b/proxy-default.conf new file mode 100644 index 0000000..cc27e1e --- /dev/null +++ b/proxy-default.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name localhost; + + location /admin/ { + proxy_pass http://portal:3000/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Scheme $scheme; + proxy_connect_timeout 5; + proxy_send_timeout 60; + proxy_read_timeout 70; + proxy_set_header X-Forwarded-Proto $scheme; + } + +}