Advertisement
Djoin

Untitled

Dec 26th, 2021
1,013
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.75 KB | None | 0 0
  1. server {
  2.  
  3.     root /var/www/compas/public;
  4.  
  5.     index index.php index.html index.htm index.nginx-debian.html;
  6.  
  7.     server_name crm.compas.xyz www.crm.compas.xyz;
  8.  
  9.     location / {
  10.                 try_files $uri $uri/ /index.php?$query_string;
  11.         }
  12.  
  13.     location /daloradius/ {
  14.     proxy_pass http://192.168.97.240/;
  15.     proxy_set_header Host $host;
  16.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  17.     proxy_set_header X-Real-IP $remote_addr;
  18.     proxy_set_header HTTPS YES;
  19.         proxy_redirect default;
  20.     }
  21.     # pass PHP scripts to FastCGI server
  22.     #
  23.     location ~ \.php$ {
  24.         include snippets/fastcgi-php.conf;
  25.    
  26.         # With php-fpm (or other unix sockets):
  27.         fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  28.         # With php-cgi (or other tcp sockets):
  29.     #   fastcgi_pass 127.0.0.1:9000;
  30.     }
  31.  
  32.     # deny access to .htaccess files, if Apache's document root
  33.     # concurs with nginx's one
  34.     #
  35.     location ~ /\.ht {
  36.         deny all;
  37.     }
  38.  
  39.     listen [::]:443 ssl ipv6only=on; # managed by Certbot
  40.     listen 443 ssl; # managed by Certbot
  41.     ssl_certificate /etc/letsencrypt/live/crm.compas.xyz-0001/fullchain.pem; # managed by Certbot
  42.     ssl_certificate_key /etc/letsencrypt/live/crm.compas.xyz-0001/privkey.pem; # managed by Certbot
  43.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  44.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  45.  
  46.  
  47. }
  48.  
  49. server {
  50.  
  51.     if ($host = www.crm.compas.xyz) {
  52.         return 301 https://$host$request_uri;
  53.     } # managed by Certbot
  54.  
  55.  
  56.     if ($host = crm.compas.xyz) {
  57.         return 301 https://$host$request_uri;
  58.     } # managed by Certbot
  59.  
  60.  
  61.     listen 80 default_server;
  62.     listen [::]:80 default_server;
  63.  
  64.     server_name crm.compas.xyz www.crm.compas.xyz;
  65.     return 404; # managed by Certbot
  66.  
  67.  
  68. }
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement