Skip to content

Instantly share code, notes, and snippets.

@novomirskoy
Created June 26, 2015 11:29
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 novomirskoy/30938d7711b2ffcf2611 to your computer and use it in GitHub Desktop.
Save novomirskoy/30938d7711b2ffcf2611 to your computer and use it in GitHub Desktop.
nginx config for flarum
server {
listen 80;
root /vagrant;
index index.html index.htm index.php app.php app_dev.php;
# Make site accessible from ...
server_name 192.168.29.29.xip.io flarum.dev;
access_log /var/log/nginx/vagrant.com-access.log;
error_log /var/log/nginx/vagrant.com-error.log error;
charset utf-8;
location / {
try_files $uri $uri/ /app.php?$query_string /index.php?$query_string;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
# pass the PHP scripts to php5-fpm
# Note: .php$ is susceptible to file upload attacks
# Consider using: "location ~ ^/(index|app|app_dev|config).php(/|$) {"
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
# With php5-fpm:
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param LARA_ENV local; # Environment variable for Laravel
fastcgi_param HTTPS off;
}
# Deny .htaccess file access
location ~ /\.ht {
deny all;
}
}
@phizaz
Copy link

phizaz commented Sep 18, 2017

Please follow the http://flarum.org/docs/installation/ guidelines for nginx configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment