salt/states/roles/maintain/lightbooks/nginx.conf

44 lines
1.1 KiB
Nginx Configuration File

server {
listen *:8000;
server_name books.actcur.com;
root /usr/share/webapps/lightbooks/public; #Path of lightbooks2 web directory
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
expires max;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location ~ \..*/.*\.php$ {
return 403;
}
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location / {
try_files $1 $uri $uri/ /index.php$is_args$args;
}
location ~ ^/index\.php(.*)$ {
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; #Replace with the port if php fpm is configured to run on port.
fastcgi_param SCRIPT_FILENAME /usr/share/webapps/lightbooks/public/index.php; #Replace with lightbooks2 web index.php file path.
fastcgi_param LIGHTBOOKSWEB_CONFIGDIR /etc/lightbooks;
fastcgi_param REMOTE_USER $remote_user;
}
}