Advertisement
Guest User

Untitled

a guest
Aug 29th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.48 KB | None | 0 0
  1. I'm having trouble getting certbot to pick up my server block. The block is contained in its own .conf file, which is included in the nginx.conf. Certbot can successfully verify the domain and generate the certificate but it can't automatically add it to the .conf file as it cant be found. The error i get is "Could not automatically find a matching server block for at.events. Set the `server_name` directive to use the Nginx installer."
  2.  
  3. Here's my conf file
  4.  
  5. server {
  6.  listen 80;
  7.  server_name www.site1.com site1.com;
  8.  location / {
  9.    access_log off;
  10.    proxy_pass http://site1.example.com;
  11.  }
  12. }
  13.  
  14. Here's the nginx.conf
  15.  
  16. user  daemon daemon;
  17. worker_processes  auto;
  18.  
  19. error_log  "/opt/bitnami/nginx/logs/error.log";
  20.  
  21. pid        "/opt/bitnami/nginx/logs/nginx.pid";
  22.  
  23.  
  24. events {
  25.  
  26.     worker_connections  1024;
  27. }
  28.  
  29.  
  30. http {
  31.     server_names_hash_bucket_size 128;
  32.     include       mime.types;
  33.     default_type  application/octet-stream;
  34.  
  35.     client_body_temp_path  "/opt/bitnami/nginx/tmp/client_body" 1 2;
  36.     proxy_temp_path "/opt/bitnami/nginx/tmp/proxy" 1 2;
  37.     fastcgi_temp_path "/opt/bitnami/nginx/tmp/fastcgi" 1 2;
  38.     scgi_temp_path "/opt/bitnami/nginx/tmp/scgi" 1 2;
  39.     uwsgi_temp_path "/opt/bitnami/nginx/tmp/uwsgi" 1 2;
  40.  
  41.     access_log  "/opt/bitnami/nginx/logs/access.log";
  42.  
  43.     sendfile        on;
  44.  
  45.     keepalive_timeout  65;
  46.  
  47.     gzip on;
  48.     gzip_http_version 1.1;
  49.     gzip_comp_level 2;
  50.     gzip_proxied any;
  51.     gzip_vary on;
  52.     gzip_types text/plain
  53.                text/xml
  54.                text/css
  55.                text/javascript
  56.                application/json
  57.                application/javascript
  58.                application/x-javascript
  59.                application/ecmascript
  60.                application/xml
  61.                application/rss+xml
  62.                application/atom+xml
  63.                application/rdf+xml
  64.                application/xml+rss
  65.                application/xhtml+xml
  66.                application/x-font-ttf
  67.                application/x-font-opentype
  68.                application/vnd.ms-fontobject
  69.                image/svg+xml
  70.                image/x-icon
  71.                application/atom_xml;
  72.  
  73.     gzip_buffers 16 8k;
  74.  
  75.     add_header X-Frame-Options SAMEORIGIN;
  76.     add_header CHOST $host;
  77.     proxy_set_header CHOST $host;
  78.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  79.  
  80.     client_max_body_size 20M;
  81.  
  82.     include "/opt/bitnami/nginx/conf/bitnami/bitnami.conf";
  83.     include "/opt/bitnami/nginx/conf/sites/*.conf";
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement