Created
May 14, 2024 14:27
-
-
Save johnfelipe/e86c8ee90dce55e30d336e34bdb4028c to your computer and use it in GitHub Desktop.
This file contains 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
upstream sonarqube { | |
keepalive 32; | |
#server ce-sonarqube:9000; # sonarqube ip and port | |
server 192.168.20.25:9000; # sonarqube ip and port | |
} | |
server { | |
listen 80; # Listen on port 80 for IPv4 requests | |
server_name $host; | |
return 301 https://$host:8443$request_uri; # replace '8443' with your https port | |
} | |
server { | |
listen 443 ssl; # Listen on port 443 for IPv4 requests | |
server_name 192.168.20.25:8443; # replace '$host:8443' with your server domain name and port | |
# Enable support for TLS 1.2 and/or 1.3 | |
ssl_protocols TLSv1.2 TLSv1.3; | |
# SSL certificate - replace as required with your own trusted certificate | |
ssl_certificate /etc/ssl/fullchain.pem; | |
ssl_certificate_key /etc/ssl/privkey.pem; | |
# logging | |
access_log /var/log/nginx/sonar.access.log; | |
error_log /var/log/nginx/sonar.error.log; | |
proxy_buffers 16 64k; | |
proxy_buffer_size 128k; | |
large_client_header_buffers 4 8k; | |
location / { | |
proxy_pass http://sonarqube; | |
proxy_redirect default; | |
proxy_http_version 1.1; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; | |
proxy_set_header Host $host; | |
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_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Port 8443; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment