Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- # Set server on a port
- listen xxx.xx.x.xx:yyy; # ip:port
- # OR
- listen yyy; # port
- # Set server encoding
- charset utf-8;
- # Path & access rights
- root /path/to/server_files/location;
- # Default server page name
- index index.html index.htm;
- # Server name
- server_name myServerName;
- # Default nginx autentification
- auth_basic "closed site";
- auth_basic_user_file /etc/nginx/.htpasswd;
- # Set path to logs
- access_log /your/path/to/logs/accesslog.txt;
- error_log /your/path/to/logs/errorlog.txt;
- # Disable cache
- expires -1;
- # Set cgi params
- location /cgi-bin/ {
- fastcgi_pass unix:/var/run/fcgiwrap.socket;
- fastcgi_param SCRIPT_FILENAME /path/to/server_files/location/$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
- }
- # Disable nginx autentification on custom request
- location /any_location/ {
- auth_basic off;
- }
- # Redirect request
- location /any_location/ {
- root /path/to/another/location;
- }
- }
Add Comment
Please, Sign In to add comment