Created
March 22, 2018 13:11
-
-
Save Aschen/45a3f87e83036655b0b36b0d2969d94b to your computer and use it in GitHub Desktop.
Nunux Reader Authentication with Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: | |
build: . | |
ports: | |
- "56432:3000" | |
links: | |
- redis | |
environment: | |
- NODE_ENV=production | |
- APP_REDIS_URI=redis://redis:6379/5 | |
- APP_EMBEDDED_DAEMONS=feed-updater | |
- APP_PORT=3000 | |
- APP_REALM=https://****** | |
- APP_REDIS_URI=redis://redis:6379/0 | |
- APP_SESSION_SECRET=JkdelkoUIJZIjsenukJA | |
- APP_ADMIN=aschen | |
- APP_GOOGLE_KEY=aaa | |
- APP_GOOGLE_SECRET=bbb | |
- APP_AUTH_PROXY_HEADER=X-WEBAUTH-USER | |
redis: | |
image: redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name ******; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name ******; | |
ssl_certificate /etc/letsencrypt/live/******/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/******/privkey.pem; | |
access_log /******/nunux-reader/log/access.log; | |
include snippets/ssl-params.conf; | |
include snippets/letsencrypt.conf; | |
auth_basic "Restricted"; | |
auth_basic_user_file /******/.htpasswd; | |
location / { | |
proxy_set_header X-WEBAUTH-USER $remote_user; | |
proxy_pass http://localhost:56432; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
allow 127.0.0.1; | |
deny all; | |
satisfy any; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment