Skip to content

Instantly share code, notes, and snippets.

@etissieres
Created February 10, 2016 14:15
Show Gist options
  • Save etissieres/b5df2da35be4ac61e50b to your computer and use it in GitHub Desktop.
Save etissieres/b5df2da35be4ac61e50b to your computer and use it in GitHub Desktop.
Nginx config
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/myapp/webapp;
index index.html index.htm;
server_name www.server.com;
location / {
try_files $uri $uri/ =404;
}
location /api {
proxy_pass http://localhost:1337;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/phpmyadmin {
root /usr/share;
index index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment