Skip to content

Instantly share code, notes, and snippets.

@Wruczek
Created February 2, 2017 21:58
Show Gist options
  • Save Wruczek/6ea965815e11a6c4f86c2771c65bda48 to your computer and use it in GitHub Desktop.
Save Wruczek/6ea965815e11a6c4f86c2771c65bda48 to your computer and use it in GitHub Desktop.
ts-website nginx configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
#deny access to .htaccess files, if Apache's document root
#concurs with nginx's one
location ~ /\.ht {
deny all;
}
#error pages - REMEBER TO CHANGE THE PATH!
error_page 403 /path_to_ts-website_please_change_me/errorpages/403.html;
error_page 404 /path_to_ts-website_please_change_me/errorpages/404.html;
error_page 500 502 503 504 /path_to_ts-website_please_change_me/errorpages/500.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment