Skip to content

Commit 1488005

Browse files
Arturo Blancomadito
andauthored
Add support for osticket (hestiacp#1586)
Co-authored-by: Arturo Blanco <ablanco@ablanco.es>
1 parent 0607462 commit 1488005

File tree

2 files changed

+187
-0
lines changed

2 files changed

+187
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#=======================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
#=======================================================================#
5+
6+
server {
7+
listen %ip%:%web_ssl_port% ssl http2;
8+
server_name %domain_idn% %alias_idn%;
9+
root %docroot%;
10+
index index.php index.html index.htm;
11+
access_log /var/log/nginx/domains/%domain%.log combined;
12+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
13+
error_log /var/log/nginx/domains/%domain%.error.log error;
14+
15+
ssl_certificate %ssl_pem%;
16+
ssl_certificate_key %ssl_key%;
17+
ssl_stapling on;
18+
ssl_stapling_verify on;
19+
20+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
21+
22+
location = /favicon.ico {
23+
log_not_found off;
24+
access_log off;
25+
}
26+
27+
location = /robots.txt {
28+
allow all;
29+
log_not_found off;
30+
access_log off;
31+
}
32+
33+
set $path_info "";
34+
35+
location ~ /include {
36+
deny all;
37+
return 403;
38+
}
39+
40+
if ($request_uri ~ "^/api(/[^\?]+)") {
41+
set $path_info $1;
42+
}
43+
44+
location ~ ^/api/(?:tickets|tasks).*$ {
45+
try_files $uri $uri/ /api/http.php?$query_string;
46+
}
47+
48+
if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
49+
set $path_info $1;
50+
}
51+
52+
if ($request_uri ~ "^/.*\.php(/[^\?]+)") {
53+
set $path_info $1;
54+
}
55+
56+
location ~ ^/scp/ajax.php/.*$ {
57+
try_files $uri $uri/ /scp/ajax.php?$query_string;
58+
}
59+
60+
location ~ ^/ajax.php/.*$ {
61+
try_files $uri $uri/ /ajax.php?$query_string;
62+
}
63+
64+
location / {
65+
try_files $uri $uri/ index.php;
66+
}
67+
68+
location ~ \.php$ {
69+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
70+
71+
fastcgi_param PATH_INFO $path_info;
72+
fastcgi_pass %backend_lsnr%;
73+
fastcgi_index index.php;
74+
include /etc/nginx/fastcgi_params;
75+
}
76+
77+
location /error/ {
78+
alias %home%/%user%/web/%domain%/document_errors/;
79+
}
80+
81+
location ~* "/\.(htaccess|htpasswd)$" {
82+
deny all;
83+
return 404;
84+
}
85+
86+
location /vstats/ {
87+
alias %home%/%user%/web/%domain%/stats/;
88+
include %home%/%user%/web/%domain%/stats/auth.conf*;
89+
}
90+
91+
include /etc/nginx/conf.d/phpmyadmin.inc*;
92+
include /etc/nginx/conf.d/phppgadmin.inc*;
93+
include /etc/nginx/conf.d/webmail.inc*;
94+
95+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
96+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#=======================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
#=======================================================================#
5+
6+
server {
7+
listen %ip%:%web_port%;
8+
server_name %domain_idn% %alias_idn%;
9+
root %docroot%;
10+
index index.php index.html index.htm;
11+
access_log /var/log/nginx/domains/%domain%.log combined;
12+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
13+
error_log /var/log/nginx/domains/%domain%.error.log error;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
16+
17+
location = /favicon.ico {
18+
log_not_found off;
19+
access_log off;
20+
}
21+
22+
location = /robots.txt {
23+
allow all;
24+
log_not_found off;
25+
access_log off;
26+
}
27+
28+
set $path_info "";
29+
30+
location ~ /include {
31+
deny all;
32+
return 403;
33+
}
34+
35+
if ($request_uri ~ "^/api(/[^\?]+)") {
36+
set $path_info $1;
37+
}
38+
39+
location ~ ^/api/(?:tickets|tasks).*$ {
40+
try_files $uri $uri/ /api/http.php?$query_string;
41+
}
42+
43+
if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
44+
set $path_info $1;
45+
}
46+
47+
if ($request_uri ~ "^/.*\.php(/[^\?]+)") {
48+
set $path_info $1;
49+
}
50+
51+
location ~ ^/scp/ajax.php/.*$ {
52+
try_files $uri $uri/ /scp/ajax.php?$query_string;
53+
}
54+
55+
location ~ ^/ajax.php/.*$ {
56+
try_files $uri $uri/ /ajax.php?$query_string;
57+
}
58+
59+
location / {
60+
try_files $uri $uri/ index.php;
61+
}
62+
63+
location ~ \.php$ {
64+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
65+
66+
fastcgi_param PATH_INFO $path_info;
67+
fastcgi_pass %backend_lsnr%;
68+
fastcgi_index index.php;
69+
include /etc/nginx/fastcgi_params;
70+
}
71+
72+
location /error/ {
73+
alias %home%/%user%/web/%domain%/document_errors/;
74+
}
75+
76+
location ~* "/\.(htaccess|htpasswd)$" {
77+
deny all;
78+
return 404;
79+
}
80+
81+
location /vstats/ {
82+
alias %home%/%user%/web/%domain%/stats/;
83+
include %home%/%user%/web/%domain%/stats/auth.conf*;
84+
}
85+
86+
include /etc/nginx/conf.d/phpmyadmin.inc*;
87+
include /etc/nginx/conf.d/phppgadmin.inc*;
88+
include /etc/nginx/conf.d/webmail.inc*;
89+
90+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
91+
}

0 commit comments

Comments
 (0)