mirror of
https://github.com/YunoHost-Apps/etherpad_ynh.git
synced 2024-09-03 18:36:10 +02:00
50 lines
2.2 KiB
Nginx Configuration File
50 lines
2.2 KiB
Nginx Configuration File
location __PATH__/ {
|
|
|
|
# Force usage of https
|
|
if ($scheme = http) {
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
|
}
|
|
|
|
rewrite ^__PATH__/$ __PATH__/ break;
|
|
rewrite ^__PATH__/locales/(.*) __PATH__/locales/$1 break;
|
|
rewrite ^__PATH__/locales.json __PATH__/locales.json break;
|
|
rewrite ^__PATH__/admin(.*) __PATH__/admin/$1 break;
|
|
rewrite ^__PATH__/p/(.*) __PATH__/p/$1 break;
|
|
rewrite ^__PATH__/static/(.*) __PATH__/static/$1 break;
|
|
rewrite ^__PATH__/pluginfw/(.*) __PATH__/pluginfw/$1 break;
|
|
rewrite ^__PATH__/javascripts/(.*) __PATH__/javascripts/$1 break;
|
|
rewrite ^__PATH__/socket.io/(.*) __PATH__/socket.io/$1 break;
|
|
rewrite ^__PATH__/ep/(.*) __PATH__/ep/$1 break;
|
|
rewrite ^__PATH__/minified/(.*) __PATH__/minified/$1 break;
|
|
rewrite ^__PATH__/api/(.*) __PATH__/api/$1 break;
|
|
rewrite ^__PATH__/ro/(.*) __PATH__/ro/$1 break;
|
|
rewrite ^__PATH__/error/(.*) __PATH__/error/$1 break;
|
|
rewrite ^__PATH__/jserror(.*) __PATH__/jserror$1 break;
|
|
rewrite ^__PATH__/redirect(.*) __PATH__/redirect$1 break;
|
|
rewrite __PATH__/favicon.ico __PATH__/favicon.ico break;
|
|
rewrite __PATH__/robots.txt __PATH__/robots.txt break;
|
|
rewrite __PATH__/(.*) __PATH__/p/$1;
|
|
|
|
proxy_pass http://127.0.0.1:__PORT__/;
|
|
proxy_set_header Host $host;
|
|
proxy_pass_header Server;
|
|
|
|
# be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr; # http://wiki.nginx.org/HttpProxyModule
|
|
proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP
|
|
proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used
|
|
proxy_set_header Host $host; # pass the host header
|
|
proxy_http_version 1.1; # recommended with keepalive connections
|
|
|
|
# WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
# Include SSOWAT user panel.
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
}
|
|
|
|
location ~* __PATH__/p/[^/]*(_|%|\*)[^/]*/export/etherpad {
|
|
return 404;
|
|
}
|