Guest User

Untitled

a guest
Jul 27th, 2024
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.51 KB | None | 0 0
  1. server {
  2. server_name CENSORED;
  3. root /var/www/html/osticket/upload;
  4. index index.php index.html index.htm;
  5. access_log /var/log/nginx/access.log;
  6. error_log /var/log/nginx/error.log;
  7.  
  8.  
  9. # Enable gzip
  10. gzip on;
  11. gzip_min_length 1000;
  12. gzip_types text/plain application/x-javascript text/xml text/css application/xml;
  13.  
  14. set $path_info "";
  15.  
  16. location ~ /include {
  17. deny all;
  18. return 403;
  19. }
  20.  
  21. if ($request_uri ~ "^/api(/[^\?]+)") {
  22. set $path_info $1;
  23. }
  24.  
  25. location ~ ^/api/(?:tickets|tasks).*$ {
  26. try_files $uri $uri/ /api/http.php?$query_string;
  27. }
  28.  
  29. if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
  30. set $path_info $1;
  31. }
  32.  
  33. location ~ ^/scp/ajax.php/.*$ {
  34. try_files $uri $uri/ /scp/ajax.php?$query_string;
  35. }
  36.  
  37. location / {
  38. try_files $uri $uri/ index.php;
  39. }
  40.  
  41. location ~ \.php$ {
  42. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43. include fastcgi_params;
  44. include snippets/fastcgi-php.conf;
  45. fastcgi_pass unix:/run/php/php8.1-fpm.sock;
  46. }
  47.  
  48.     listen 443 ssl; # managed by Certbot
  49.     ssl_certificate /etc/letsencrypt/live/CENSORED/fullchain.pem; # managed by Certbot
  50.     ssl_certificate_key /etc/letsencrypt/live/CENSORED/privkey.pem; # managed by Certbot
  51.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  52.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  53.  
  54.  
  55. }
  56. server {
  57.     if ($host = CENSORED) {
  58.         return 301 https://$host$request_uri;
  59.     } # managed by Certbot
  60.  
  61.  
  62. listen 80;
  63. server_name CENSORED;
  64.     return 404; # managed by Certbot
  65.  
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment