Skip to content

Instantly share code, notes, and snippets.

@metalivedev
Created June 14, 2013 22:17
Show Gist options
  • Save metalivedev/5785719 to your computer and use it in GitHub Desktop.
Save metalivedev/5785719 to your computer and use it in GitHub Desktop.
Nginx config to proxy docker on localhost
add this to your /etc/nginx/sites-enabled/default
location /docker/ {
proxy_pass http://localhost:4243/;
}
In context:
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
disable_symlinks off;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location /docker/ {
proxy_pass http://localhost:4243/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment