Guest User

Untitled

a guest
Jul 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. server {
  2. # Set server on a port
  3. listen xxx.xx.x.xx:yyy; # ip:port
  4. # OR
  5. listen yyy; # port
  6.  
  7. # Set server encoding
  8. charset utf-8;
  9.  
  10. # Path & access rights
  11. root /path/to/server_files/location;
  12.  
  13. # Default server page name
  14. index index.html index.htm;
  15.  
  16. # Server name
  17. server_name myServerName;
  18.  
  19. # Default nginx autentification
  20. auth_basic "closed site";
  21. auth_basic_user_file /etc/nginx/.htpasswd;
  22.  
  23. # Set path to logs
  24. access_log /your/path/to/logs/accesslog.txt;
  25. error_log /your/path/to/logs/errorlog.txt;
  26.  
  27. # Disable cache
  28. expires -1;
  29.  
  30. # Set cgi params
  31. location /cgi-bin/ {
  32. fastcgi_pass unix:/var/run/fcgiwrap.socket;
  33. fastcgi_param SCRIPT_FILENAME /path/to/server_files/location/$fastcgi_script_name;
  34. include /etc/nginx/fastcgi_params;
  35. }
  36.  
  37.  
  38. # Disable nginx autentification on custom request
  39. location /any_location/ {
  40. auth_basic off;
  41. }
  42.  
  43. # Redirect request
  44. location /any_location/ {
  45. root /path/to/another/location;
  46. }
  47. }
Add Comment
Please, Sign In to add comment