sr.ht-nginx/hub.sr.ht.conf

59 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-09-01 00:05:28 +02:00
server {
include sourcehut.conf;
include port80.conf;
server_name sr.ht;
2020-09-01 00:05:28 +02:00
# Redirect for legacy.sr.ht
2020-09-01 00:05:28 +02:00
location ~ ^/[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$ {
return 302 https://l.sr.ht$request_uri;
}
}
server {
include sourcehut.conf;
include port443.conf;
include hub-ssl.conf;
server_name sr.ht;
2020-09-01 00:05:28 +02:00
location / {
proxy_pass http://127.0.0.1:5014;
include headers.conf;
2023-09-14 14:13:53 +02:00
add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline'; img-src * data:; script-src 'self'; frame-ancestors 'none'" always;
include web.conf;
2020-09-01 00:05:28 +02:00
}
2022-11-02 11:57:04 +01:00
location /query {
proxy_pass http://127.0.0.1:5114;
include graphql.conf;
}
2020-09-01 00:05:28 +02:00
location /static {
root /usr/lib/$python/site-packages/hubsrht;
2020-09-01 00:05:28 +02:00
expires 30d;
}
# Redirect for legacy.sr.ht
2020-09-01 00:05:28 +02:00
location ~ ^/[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$ {
return 302 https://l.sr.ht$request_uri;
}
}
# The project hub initially ran at hub.sr.ht for early testing and development
# before being moved to the top-level domain.
server {
include sourcehut.conf;
include port80.conf;
server_name hub.sr.ht;
}
server {
include sourcehut.conf;
include port443.conf;
include hub-ssl.conf;
server_name hub.sr.ht;
location / {
return 302 https://sr.ht$request_uri;
}
}