mirror of
https://github.com/YunoHost-Apps/opensondage_ynh.git
synced 2024-09-03 19:46:28 +02:00
39 lines
1.5 KiB
Nginx Configuration File
39 lines
1.5 KiB
Nginx Configuration File
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
|
location __PATH__/ {
|
|
|
|
# Path to source
|
|
alias __INSTALL_DIR__/;
|
|
|
|
client_max_body_size 20M;
|
|
|
|
rewrite "^__PATH__/([a-zA-Z0-9-]+)$" "__PATH__/studs.php?poll=$1";
|
|
rewrite "^__PATH__/([a-zA-Z0-9-]+)/action/([a-zA-Z_-]+)/(.+)$" "__PATH__/studs.php?poll=$1&$2=$3";
|
|
rewrite "^__PATH__/([a-zA-Z0-9-]+)/vote/([a-zA-Z0-9]{16})$" "__PATH__/studs.php?poll=$1&vote=$2";
|
|
|
|
# Admin requires the private poll ID, 24-char long
|
|
rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin$" "__PATH__/adminstuds.php?poll=$1";
|
|
rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin/vote/([a-zA-Z0-9]{16})$" "__PATH__/adminstuds.php?poll=$1&vote=$2";
|
|
rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin/action/([a-zA-Z_-]+)(/(.+))?$" "__PATH__/adminstuds.php?poll=$1&$2=$4";
|
|
|
|
index index.html index.htm index.php;
|
|
|
|
try_files $uri $uri/ __PATH__/index.php;
|
|
|
|
location ~ [^/]\.php(/|$) {
|
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
|
|
|
include fastcgi_params;
|
|
fastcgi_param REMOTE_USER $remote_user;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
fastcgi_param HTTPS on;
|
|
}
|
|
|
|
# Include SSOWAT user panel.
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
}
|
|
|
|
location ~ ^__PATH__/(data|config|\.ht|db_structure\.xml|README) {
|
|
deny all;
|
|
}
|