public
Last active

NGINX configuration for OntoWiki

  • Download Gist
ontowiki
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
server {
listen [::]:80 default_server ipv6only=off;
 
root /var/www/localhost/;
 
error_log /tmp/localhost-error.log;
 
index index.html index.htm index.php;
 
# You also have to set `post_max_size = 90M` and `upload_max_filesize = 90M` in php.ini
client_max_body_size 90M;
 
# Make site accessible from http://localhost/
server_name localhost;
 
# change `/ontowiki` to `/` for the location and rewrite (below) if it is installed in the root
location /ontowiki {
# check if the request is an exception and should not be handled by the index.php
if ($request_filename !~ ((extensions|libraries).*|\.(js|ico|gif|jpg|png|css|swf|json))$) {
set $is_exception "f";
}
 
# rewrite all other URLs to index.php
if ($is_exception = "f") {
rewrite ^/ontowiki/(.*)$ /ontowiki/index.php last;
}
}
 
# pass the PHP scripts to FastCGI server
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param ONTOWIKI_APACHE_MOD_REWRITE_ENABLED 1;
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.