Skip to content

Instantly share code, notes, and snippets.

@forsaken1
Created February 21, 2017 18:09
Show Gist options
  • Save forsaken1/4a1a4d432a2d2ab793bb11a1573ef57e to your computer and use it in GitHub Desktop.
Save forsaken1/4a1a4d432a2d2ab793bb11a1573ef57e to your computer and use it in GitHub Desktop.
Nginx phoenix config with basic auth
upstream uphill_rating {
server 127.0.0.1:4000;
}
server{
listen 80;
server_name uphill.krylov-alexey.ru;
location / {
try_files $uri @proxy;
}
location @proxy {
include proxy_params;
proxy_redirect off;
proxy_pass http://uphill_rating;
}
location /admin {
proxy_redirect off;
proxy_pass http://uphill_rating;
auth_basic "Admin panel";
auth_basic_user_file /home/forsaken/apps/uphill_rating/.htpasswd;
}
#location ~ /\. { deny all; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment