From 552ef3de415085cddf925dfa6158f86e83be89e1 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 2 Sep 2019 16:14:12 -0500 Subject: [PATCH] try fixing subpath proxy --- ops/nginx/conf.d/filterlists.conf | 5 +---- src/FilterLists.Web/Dockerfile | 1 + .../nginx/conf.d/filterlists.conf | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/FilterLists.Web/nginx/conf.d/filterlists.conf diff --git a/ops/nginx/conf.d/filterlists.conf b/ops/nginx/conf.d/filterlists.conf index 61e948a7a..758764ac4 100644 --- a/ops/nginx/conf.d/filterlists.conf +++ b/ops/nginx/conf.d/filterlists.conf @@ -21,10 +21,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } - location ^~ / { - if (!-e $request_filename) { - rewrite http://web:80 break; - } + location / { proxy_pass http://web:80; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/src/FilterLists.Web/Dockerfile b/src/FilterLists.Web/Dockerfile index a6dd8bcb4..0406abc2a 100644 --- a/src/FilterLists.Web/Dockerfile +++ b/src/FilterLists.Web/Dockerfile @@ -3,6 +3,7 @@ # init base FROM nginx:alpine as base +COPY ./src/FilterLists.Web/nginx/conf.d /etc/nginx/conf.d # init build FROM node:alpine as build diff --git a/src/FilterLists.Web/nginx/conf.d/filterlists.conf b/src/FilterLists.Web/nginx/conf.d/filterlists.conf new file mode 100644 index 000000000..b4b2819e8 --- /dev/null +++ b/src/FilterLists.Web/nginx/conf.d/filterlists.conf @@ -0,0 +1,18 @@ +# https://raw.githubusercontent.com/react-boilerplate/react-boilerplate/master/app/.nginx.conf + +## +# Put this file in /etc/nginx/conf.d folder and make sure +# you have a line 'include /etc/nginx/conf.d/*.conf;' +# in your main nginx configuration file +## + +server { + listen 80; + + # Always serve index.html for any request + location / { + # Set path + root /var/www/; + try_files $uri /index.html; + } +} \ No newline at end of file