Guest User

nginx

a guest
Jul 9th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.72 KB | None | 0 0
  1. user nginx;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log;
  4. pid /run/nginx.pid;
  5.  
  6. include /usr/share/nginx/modules/*.conf;
  7.  
  8. events {
  9.     worker_connections 1024;
  10. }
  11.  
  12. http {
  13.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  14.                       '$status $body_bytes_sent "$http_referer" '
  15.                       '"$http_user_agent" "$http_x_forwarded_for"';
  16.  
  17.     access_log  /var/log/nginx/access.log  main;
  18.  
  19.     sendfile            on;
  20.     tcp_nopush          on;
  21.     tcp_nodelay         on;
  22.     keepalive_timeout   65;
  23.     types_hash_max_size 2048;
  24.  
  25.     include             /etc/nginx/mime.types;
  26.     default_type        application/octet-stream;
  27.  
  28.     include /etc/nginx/conf.d/*.conf;
  29.  
  30. server {
  31.     server_name grafana.***.com;
  32.     root /usr/share/nginx/html;
  33.     index index.html index.htm;
  34.  
  35.     location / {
  36.         proxy_pass http://localhost:8888/;
  37.     }
  38.  
  39.     listen 443 ssl; # managed by Certbot
  40.     ssl_certificate /etc/letsencrypt/live/grafana.***.com/fullchain.pem; # managed by Certbot
  41.     ssl_certificate_key /etc/letsencrypt/live/grafana.***.com/privkey.pem; # managed by Certbot
  42.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  43.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  44.  
  45. }
  46.  
  47. server {
  48.     server_name grafana.***.com;
  49.     root /usr/share/nginx/html;
  50.     index index.html index.htm;
  51.  
  52.     location /influxdb/ {
  53.         auth_basic "Restricted Area";
  54.         auth_basic_user_file /etc/nginx/.htpasswd;
  55.         proxy_pass http://localhost:8086/;
  56.     }
  57. }
  58.  
  59. server {
  60.     if ($host = grafana.***.com) {
  61.         return 301 https://$host$request_uri;
  62.     } # managed by Certbot
  63.  
  64.  
  65.   listen 80;
  66.   server_name grafana.***.com;
  67.     return 404; # managed by Certbot
  68.  
  69.  
  70. }}
Add Comment
Please, Sign In to add comment