summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordan <[email protected]>2023-05-30 11:47:05 -0400
committerdan <[email protected]>2023-05-30 11:47:05 -0400
commit68616f40cc7786ac2d001db4bada203bfe477bc4 (patch)
treeb7110e6082e149738825c8990581e28dc4949422
parent1d517b83dc36a1ec6cf70f08321971f4be173040 (diff)
downloaddump-68616f40cc7786ac2d001db4bada203bfe477bc4.tar.gz
dump-68616f40cc7786ac2d001db4bada203bfe477bc4.tar.bz2
dump-68616f40cc7786ac2d001db4bada203bfe477bc4.zip
add example nginx conf
-rw-r--r--example-nginx-server.conf37
1 files changed, 37 insertions, 0 deletions
diff --git a/example-nginx-server.conf b/example-nginx-server.conf
new file mode 100644
index 0000000..1c38cb9
--- /dev/null
+++ b/example-nginx-server.conf
@@ -0,0 +1,37 @@
+upstream backend {
+ server localhost:3030;
+}
+
+server {
+ listen 80;
+ listen [::]:80;
+
+ server_name app.example.com;
+
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 default_server ssl;
+ server_name app.example.com;
+
+ ssl_certificate /path/to/app.example.com.pem.crt;
+ ssl_certificate_key /path/to/app.example.com.pem.key;
+
+ location /api/ {
+ proxy_pass http://backend/;
+ }
+
+ # If static app on CDN / GH pages / other static server
+ location / {
+ # Any path other than the locations in the regex should be rewritten
+ # to `/`, as these are routes within the React (i.e. Client-side) Router
+ rewrite ^/(?!index\.html|static|.*\.ico|logo[0-9]+\.png)(.*)$ / break;
+ proxy_pass "https://our-app.cdn.example.com";
+ }
+
+ # Alternatively, if static files are on this machine
+# location / {
+# root /www-public;
+# }
+}