-
Notifications
You must be signed in to change notification settings - Fork 117
/
default
32 lines (26 loc) · 989 Bytes
/
default
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
server {
listen 80;
server_name example.com;
# ssl_certificate /etc/nginx/ssl/nginx.crt;
# ssl_certificate_key /etc/nginx/ssl/nginx.key;
access_log /var/log/nginx/access.log;
root /var/www/html;
index index.sh;
location ~ \.sh$ {
gzip off;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.sh)(/.*)$;
# Check that the Bash script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.sh;
include fastcgi.conf;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}