Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen localhost:8090;
- server_name .flaviotorres.com.br;
- server_name_in_redirect off;
- port_in_redirect off;
- valid_referers none blocked server_name;
- proxy_set_header flaviotorres.com.br $host;
- add_header SID 01;
- #charset ISO-8859-1;
- index index.php index.html index.htm ;
- root /var/www/flaviotorres/htdocs/;
- location /nginx_status {
- stub_status on;
- access_log off;
- allow 10.12.5.154;
- allow 10.10.1.35;
- deny all;
- }
- location / {
- add_header SID 01;
- #charset ISO-8859-1;
- #
- # Boas praticas inicio
- #
- gzip on;
- gzip_http_version 1.1;
- gzip_vary on;
- gzip_comp_level 6;
- gzip_proxied any;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
- gzip_disable "MSIE [1-6]\.";
- location ~* /test {
- auth_basic "Restricted";
- auth_basic_user_file htpasswd;
- location ~.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include /opt/nginx/conf/fastcgi_params;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $document_root;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $server_name;
- fastcgi_param SCRIPT_FILENAME /var/www/flaviotorres/htdocs$fastcgi_script_name;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- }
- }
- #
- # habilita expires de 10 anos para imagens, swf e css
- #
- location ~* ^.*\.(ico|jpg|jpeg|jpe|gif|png|swf|css|js)(\?[0-9]+)?$ {
- add_header SID 01;
- access_log off;
- add_header Cache-Control public;
- valid_referers server_names blocked none;
- if ($invalid_referer) {
- return 403;
- }
- if (-f $request_filename) {
- access_log off;
- expires max;
- }
- }
- #
- # habilita expires de 10 minutos html, javascript
- #
- location ~* \.(html|htm)(\?[0-9]+)?$ {
- access_log off;
- if (-f $request_filename) {
- access_log off;
- expires 10m;
- }
- }
- #
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include /opt/nginx/conf/fastcgi_params;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $document_root;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $server_name;
- fastcgi_param SCRIPT_FILENAME /var/www/flaviotorres/htdocs$fastcgi_script_name;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- }
- # Bloqueio de uso indevido de imagens do ambiente.
- #
- location ~* \.(aif|aifc|aiff|asf|asx|au|avi|bmp|djv|djvu|flv|fts|gif|ico|ief|is|jfif|jpe|jpeg|jpg|kar|m3u|mid|midi|mov|movie|mp2|mp3|mpe|mpeg|mpg|mpga|mxu|odi|out|pbm|pgm|png|pnm|ppm|qt|ra|ram|ras|rgb|rm|rpm|snd|tga|tif|tiff|wav|wax|wbmp|which|with|wm|wma|wmv|wmx|wvx|xbm|xpm|xwd)$ {
- valid_referers server_name blocked none;
- if ($invalid_referer) {
- return 403;
- }
- }
- #
- # Bloqueio de crawlers
- #
- if ($http_user_agent ~* (HTTrack|HTMLParser|libwww)) {
- return 444;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement