Skip to content

Instantly share code, notes, and snippets.

@lesstif
Created January 18, 2021 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesstif/cc5c87c0f6970a146597a15ccc02973e to your computer and use it in GitHub Desktop.
Save lesstif/cc5c87c0f6970a146597a15ccc02973e to your computer and use it in GitHub Desktop.
nginx 가상 호스트 설정
server {
listen 80;
server_name gitlab.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name gitlab.example.com;
root html;
server_tokens off;
fastcgi_hide_header X-Powered-By;
charset utf-8;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
##access_log off;
access_log /var/log/nginx/gitab-access.log combined;
error_log /var/log/nginx/gitlab-error.log error;
sendfile off;
client_max_body_size 100m;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
# Remove the Connection header if the client sends it,
# it could be close to close a keepalive connection
proxy_set_header Connection "";
location / {
proxy_pass http://127.0.0.1:9080;
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;
## prevent 504 timeout. default 60s;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
send_timeout 90;
}
location ~ /\.git {
deny all;
}
### Dropping SSLv3, ref: POODLE
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
### HSTS(HTTP Strict Transport Security)
# add_header Strict-Transport-Security "max-age=86400; includeSubdomains; preload";
ssl_certificate /etc/pki/tls/certs/example.com.crt;
ssl_certificate_key /etc/pki/tls/private/example.com.key;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment