Skip to content

Instantly share code, notes, and snippets.

@asanchez75
Forked from serverok/Dspace Nginx Config
Created February 6, 2022 13:03
Show Gist options
  • Save asanchez75/d3c48fd5277f1a936f45612195789489 to your computer and use it in GitHub Desktop.
Save asanchez75/d3c48fd5277f1a936f45612195789489 to your computer and use it in GitHub Desktop.
root@vmi465483:~# cat /etc/nginx/sites-enabled/dspace.conf
server {
server_name repositorio.unijuanpablo.edu.pe;
root /var/www/html/;
client_max_body_size 2000m;
location / {
return 301 http://repositorio.unijuanpablo.edu.pe/xmlui/;
}
location ^~ /.well-known/acme-challenge/ {
root /var/www/html;
}
location /jspui/ {
index index.jsp;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/jspui/;
proxy_redirect http://localhost:8080/jspui/ https://repositorio.unijuanpablo.edu.pe/jspui/;
proxy_buffering off;
proxy_store off;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
}
location /oai/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/oai/;
proxy_redirect http://localhost:8080/oai/ https://repositorio.unijuanpablo.edu.pe/oai/;
proxy_buffering off;
proxy_store off;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
}
location /xmlui/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/xmlui/;
proxy_redirect http://localhost:8080/xmlui https://repositorio.unijuanpablo.edu.pe/xmlui;
proxy_buffering off;
proxy_store off;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/repositorio.unijuanpablo.edu.pe/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/repositorio.unijuanpablo.edu.pe/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = repositorio.unijuanpablo.edu.pe) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name repositorio.unijuanpablo.edu.pe;
return 404; # managed by Certbot
}
root@vmi465483:~#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment