-
Notifications
You must be signed in to change notification settings - Fork 166
/
ngnix.conf.example
59 lines (53 loc) · 2.13 KB
/
ngnix.conf.example
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# PHREEZE CONF FILE FOR NGNIX
#
# This is a partial example conf file to demonstrate how to configure
# URL rewriting in ngnix for Phreeze applications. This example assumes
# that you are forwarding php requests to php-fpm via port 9000.
# you should be able to update the php location block without affecting
# the Phreeze location blocks
#
# Do not replace your entire ngnix.conf file with this, rather select the relevant
# location blocks. PLEASE NOTE that the Phreeze application location blocks
# must appear *after* the ~ \.php$ location block, otherwise you will see server
# errors due to an infinite redirection loop
server {
listen 8080;
server_name localhost;
root /path/to/htdocs;
index index.php index.html index.htm;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# NOTE: change "fastcgi_pass" to the correct port or socket as necessary
# based on your php-fpm configuration (ex. /tmp/php-fpm.sock)
#
location ~ \.php$ {
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
# url rewriting for the phreeze builder application
#
location ~ ^/phreeze/builder/(.*) {
try_files /phreeze/builder/$1 /phreeze/builder/$1/ /phreeze/builder/index.php?_REWRITE_COMMAND=$1&args;
}
# url rewriting for a Phreeze application called "example"
#
location ~ ^/example/(.*) {
try_files /example/$1 /example/$1/ /example/index.php?_REWRITE_COMMAND=$1&args;
}
# url rewriting for phreeze app that is installed in the htdocs root
#
#location ~ ^/(.*) {
# try_files /$1 /$1/ /index.php?_REWRITE_COMMAND=$1&args;
#}
# this is an alternate method of rewriting. this method is discouraged
# in the ngnix documentation for performance reasons, however it may be
# helpful or necessary in some situations. it's here for reference purposes only
#
#location ~ ^/example2/(.*) {
# if (!-e $request_filename){
# rewrite ^/example2/(.*)$ /example2/index.php?_REWRITE_COMMAND=$1? last;
# }
#}
}