-
Notifications
You must be signed in to change notification settings - Fork 74
/
mythweb.conf.nginx
62 lines (54 loc) · 1.69 KB
/
mythweb.conf.nginx
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
60
61
62
##
# mythweb configuration for nginx
# - Requires php-fpm to handle php
# - Requires fcgiwrap to handle perl
#
# please modify before use
##
server {
# If you want to run a non-SSL connection change this to 80
listen 443;
# Set up the document root to where mythweb is located
root /var/www/mythweb;
index index.html index.htm;
# Hostname of the server running mythweb
server_name localhost;
# If you want to run a non-SSL connection comment out this block
ssl_certificate certs/server.crt;
ssl_certificate_key certs/server.key;
# Configure this section for HTTP Basic Auth
location / {
auth_basic "MythWeb";
auth_basic_user_file mythweb.passwd;
index /var/www/mythweb/mythweb.php;
try_files $uri @handler;
}
# Sets up the pass-through to php-fpm
location ~ \.php {
include fastcgi_params;
fastcgi_index mythweb.php;
fastcgi_split_path_info ^(.+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param db_server localhost;
fastcgi_param db_name mythconverg;
fastcgi_param db_login mythtv;
fastcgi_param db_password mythtv;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
location ~ \.pl {
include fastcgi_params;
fastcgi_param db_server localhost;
fastcgi_param db_name mythconverg;
fastcgi_param db_login mythtv;
fastcgi_param db_password mythtv;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
# Required rewrite rules
location @handler {
rewrite /(.+\.(php|pl))/.* /$1 last;
rewrite /(pl(/.*)?)$ /mythweb.pl/$1 last;
rewrite /(.+)$ /mythweb.php/$1 last;
rewrite /(.*)$ /mythweb.php last;
}
}