Skip to content

Commit e062b72

Browse files
committed
Add changes to support clean URLs/URL Rewriting
1 parent 50ac401 commit e062b72

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nginx_vhost_creater.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
/**
44
* Nginx virtual host creater class
5-
* @author Tushar Kant Verma
65
*/
76
class NginxVhost
87
{
@@ -138,7 +137,8 @@ public function createPHPInfoFile() {
138137
location / {
139138
# First attempt to serve request as file, then
140139
# as directory, then fall back to displaying a 404.
141-
try_files \$uri \$uri/ =404;
140+
try_files \$uri \$uri/ @rewrite;
141+
expires max;
142142
}
143143
144144
location ~ \.php$ {
@@ -150,6 +150,7 @@ public function createPHPInfoFile() {
150150
fastcgi_pass unix:/var/run/php5-fpm.sock;
151151
fastcgi_index index.php;
152152
include fastcgi_params;
153+
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/{$DOMAIN}/public/$fastcgi_script_name;
153154
}
154155
location ~ /\.ht {
155156
deny all;
@@ -201,4 +202,4 @@ public function createPHPInfoFile() {
201202
die("Pass first parameter as 'create' or 'remove'");
202203
}
203204

204-
?>
205+
?>

0 commit comments

Comments
 (0)