Created
November 29, 2019 13:58
-
-
Save KamalakannanRM/6f340fc820bc03f16433d09f262ceeeb to your computer and use it in GitHub Desktop.
Nexus3 OSS Repository Manager reverse proxy through Nginx with SSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssl_certificate /etc/nginx/ssl/nexus.domain.tld/cert.pem; | |
ssl_certificate_key /etc/nginx/ssl/nexus.domain.tld/privkey.pem; | |
upstream nexus { | |
server 127.0.0.1:8081 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name nexus.domain.tld; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name nexus.domain.tld; | |
# allow large uploads of files | |
client_max_body_size 1G; | |
# optimize downloading files larger than 1G | |
#proxy_max_temp_file_size 2G; | |
proxy_send_timeout 120; | |
proxy_read_timeout 300; | |
proxy_buffering off; | |
keepalive_timeout 5 5; | |
tcp_nodelay on; | |
location / { | |
proxy_set_header Host $host:$server_port; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_redirect http:// https://; | |
proxy_pass http://nexus; | |
# Required for new HTTP-based CLI | |
proxy_http_version 1.1; | |
proxy_request_buffering off; | |
proxy_buffering off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment