|
| 1 | +## Version 2021/11/03 |
| 2 | +# make sure that your dns has a cname set for emulatorjs |
| 3 | +# In emulatorjs docker arguments, set an env variable for SUBFOLDER=/backend/ |
| 4 | +# The backend interface will be accessible at https://emulatorjs.yourdomain.com/backend/ |
| 5 | + |
| 6 | +server { |
| 7 | + listen 443 ssl; |
| 8 | + listen [::]:443 ssl; |
| 9 | + |
| 10 | + server_name emulatorjs.*; |
| 11 | + |
| 12 | + include /config/nginx/ssl.conf; |
| 13 | + |
| 14 | + client_max_body_size 0; |
| 15 | + |
| 16 | + # enable for ldap auth, fill in ldap details in ldap.conf |
| 17 | + #include /config/nginx/ldap.conf; |
| 18 | + |
| 19 | + # enable for Authelia |
| 20 | + #include /config/nginx/authelia-server.conf; |
| 21 | + |
| 22 | + location / { |
| 23 | + # enable the next two lines for http auth |
| 24 | + #auth_basic "Restricted"; |
| 25 | + #auth_basic_user_file /config/nginx/.htpasswd; |
| 26 | + |
| 27 | + # enable the next two lines for ldap auth |
| 28 | + #auth_request /auth; |
| 29 | + #error_page 401 =200 /ldaplogin; |
| 30 | + |
| 31 | + # enable for Authelia |
| 32 | + #include /config/nginx/authelia-location.conf; |
| 33 | + |
| 34 | + include /config/nginx/proxy.conf; |
| 35 | + include /config/nginx/resolver.conf; |
| 36 | + set $upstream_app emulatorjs; |
| 37 | + set $upstream_port 80; |
| 38 | + set $upstream_proto http; |
| 39 | + proxy_pass $upstream_proto://$upstream_app:$upstream_port; |
| 40 | + } |
| 41 | + |
| 42 | + location /backend { |
| 43 | + return 301 $scheme://$host/backend/; |
| 44 | + } |
| 45 | + |
| 46 | + location ^~ /backend/ { |
| 47 | + # enable the next two lines for http auth |
| 48 | + #auth_basic "Restricted"; |
| 49 | + #auth_basic_user_file /config/nginx/.htpasswd; |
| 50 | + |
| 51 | + # enable the next two lines for ldap auth |
| 52 | + #auth_request /auth; |
| 53 | + #error_page 401 =200 /ldaplogin; |
| 54 | + |
| 55 | + # enable for Authelia |
| 56 | + #include /config/nginx/authelia-location.conf; |
| 57 | + |
| 58 | + include /config/nginx/proxy.conf; |
| 59 | + include /config/nginx/resolver.conf; |
| 60 | + set $upstream_app emulatorjs; |
| 61 | + set $upstream_port 3000; |
| 62 | + set $upstream_proto http; |
| 63 | + proxy_pass $upstream_proto://$upstream_app:$upstream_port; |
| 64 | + } |
| 65 | +} |
0 commit comments