-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.sub.conf.sample.txt
36 lines (27 loc) · 1.52 KB
/
nginx.sub.conf.sample.txt
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
# Sample Nginx configuration for running NCweb in a sub-directory
# with PHP-FPM. This goes inside your server { } block. This will
# handle requests to yourdomain.com/ncweb/*
# Configuration for NCweb at /ncweb
location /ncweb {
# Where index.php is located physically on your server
alias /home/html/yourdomain.com/public_html/ncweb;
# Nginx will try to handle the request, or send it to
# index.php, or rewrite the URL and send it to the @ncweb
# handler below
try_files $uri index.php @ncweb;
# Make sure we serve static content here, and not Nginx
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|htm|html|xml|pdf|ttf|woff|woff2|svg|eot)$ {
try_files $uri @ncweb;
}
# Handle PHP
location ~ [^/]\.php(/|$) {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
# Change this to the appropriate port for your PHP-FPM
fastcgi_pass 127.0.0.1:8002;
}
}
# Rewrite handler to pass requested URL to index.php
location @ncweb {
rewrite /ncweb/(.*)$ /ncweb/index.php?/$1 last;
}