blob: 5b9d916c4afe3c1067254d62834eae90064c4384 [file] [log] [blame]
server {
listen 80;
listen [::]:80;
server_name review.leafos.org;
return 301 https://$server_name$request_uri;
root /var/www/review.leafos.org/;
access_log /var/log/nginx/access/review.leafos.org.log;
error_log /var/log/nginx/error/review.leafos.org.log;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include hsts.conf;
root /var/www/review.leafos.org/;
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
server_name review.leafos.org;
access_log /var/log/nginx/access/review.leafos.org.log;
error_log /var/log/nginx/error/review.leafos.org.log;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Accept-Encoding "";
proxy_redirect https://localhost:8080/ /;
sub_filter_types *;
# Rewrite gitiles path
sub_filter '/' 'https://git.leafos.org/';
sub_filter_once off;
}
location /robots.txt {
proxy_pass http://localhost:8080/static/robots.txt;
}
location ^~ /git.leafos.org {
# Used for login redirect on git.leafos.org
rewrite ^/git.leafos.org?(.*)$ https://git.leafos.org/$1 permanent;
}
ssl_certificate /etc/letsencrypt/live/leafos.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/leafos.org/privkey.pem; # managed by Certbot
}