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

59 lines
1.2 KiB
Plaintext

server {
include sourcehut.conf;
include port80.conf;
server_name sr.ht;
# Redirect for legacy.sr.ht
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;
location / {
proxy_pass http://127.0.0.1:5014;
include headers.conf;
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;
}
location /query {
proxy_pass http://127.0.0.1:5114;
include graphql.conf;
}
location /static {
root /usr/lib/$python/site-packages/hubsrht;
expires 30d;
}
# Redirect for legacy.sr.ht
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;
}
}