Skip to content

Instantly share code, notes, and snippets.

@teward
Last active June 12, 2016 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teward/c36c91b890f0a9c6fbf3866fbd5819f4 to your computer and use it in GitHub Desktop.
Save teward/c36c91b890f0a9c6fbf3866fbd5819f4 to your computer and use it in GitHub Desktop.
NGINX configurations for Zacharee1 on Ask Ubuntu
server {
# This is a catch-all block for any requests for domains which do not match
# the domains you actually serve, which are declared in server { } blocks
# below.
listen 80 default_server;
server_name _;
return 410;
}
server {
#listen 8080;
listen 80;
root /srv/pufferpanel/;
index index.php;
server_name x-p-w.tk;
# This is the 'virtual host' declaration of what 'host' to process this
# server block for. This block will only execute for the specified host.
# This site, however, exists on this server, and needs to be served from
# this server, so we don't need to do any reverse proxying.
client_max_body_size 20m;
client_body_timeout 120s;
location / {
try_files /public/router.php =404;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index router.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location /assets {
try_files /app/$uri =404;
}
}
server {
listen 80;
server_name xpw1.no-ip.org;
# This site goes to a different internal IP address, so we
# proxy_pass from this nginx instance to the other server
# on the network. It's called a reverse proxy because it
# goes from the outside in, and not from the inside out
# as one would normally consider a proxy as.
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://192.168.254.220;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment