View Single Post
  #2  
Old 30th April 2012, 11:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Try this instead:

Code:
server {
       listen ip:80;
       server_name www.example.com example.com;
       root /var/www/luckygaming;

       if ($http_host != "www.lucky-betting.com") {
                 rewrite ^ https://www.example.com$request_uri permanent;
       }

       index index.php index.html;

       location = /favicon.ico {
                log_not_found off;
                access_log off;
                expires max;
       }

       location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
       }

       # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }

       location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
       }
       location ~* \.(cur|ico|gif|png|jpe?g|css|js|swf|woff)((\?\d\d\d\d\d\d\d\d\d\d)|(\?s=\d\d\d\d\d\d\d\d\d\d))$ {
                expires max;
                log_not_found off;
       }
       location ~* \.(cur|ico|gif|png|jpe?g|css|js|swf|woff)(\?v\d\d?\.\d\d?\.\d\d?)$ {
                expires max;
                log_not_found off;
       }
       location ~* ^(/partner/typo3/sysext|/partner/typo3conf/ext).*\.(cur|ico|gif|png|jpe?g|css|js|swf|woff) {
                expires max;
                log_not_found off;
       }
       location = /clear.gif {
                empty_gif;
                expires max;
       }
       location ^~ /partner/typo3/gfx {
                expires max;
       }
       location ^~ /partner/typo3temp/compressor {
                expires max;
       }
       location ~* \.(sql|htaccess|htpasswd|tpl|html5|xhtml) {
                deny all;
       }

       location /partner {
                if ($query_string ~ ".+") {
          return 405;
                }
                # pass requests from logged-in users to PHP
                if ($http_cookie = 'nc_staticfilecache|be_typo_user' ) {
                        return 405;
                } # pass POST requests to PHP
                if ($request_method !~ ^(GET|HEAD)$ ) {
                        return 405;
                }
                if ($http_pragma = 'no-cache') {
                        return 405;
                }
                if ($http_cache_control = 'no-cache') {
                        return 405;
                }
                error_page 405 = @nocache;

                # serve requested content from the cache if available, otherwise pass the request to PHP
                try_files /partner/typo3temp/tx_ncstaticfilecache/$host${request_uri}index.html @nocache;
       }

       location @nocache {
                try_files $uri $uri/ /partner/index.php?$args;
       }

       location ^~ /partner/typo3temp/tx_ncstaticfilecache {
                expires 43200;
                charset utf-8;
       }

       location ~ \.php$ {
                include  fastcgi_params;
                try_files $uri =403;
                fastcgi_split_path_info ^(/partner)(/.*)$;
               # include  fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_index index.php;
       }
}
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote