News Flash:
New Version of ShopClass theme 1.4.0 is Released on 13 JUNE 2018, Please upgrade your installation.

Fiendly URLs for Nginx

If you are having general problems with Tuffclassified theme, post your questions here. This is not the place for customization or feature requests
Locked
steve
Senior
Posts: 222
Joined: Thu Oct 01, 2015 5:33 pm
Has thanked: 11 times
Been thanked: 4 times

Fiendly URLs for Nginx

Post by steve » Sat Oct 24, 2015 7:13 pm

Hello,
Does anyone have an idea how to enable friendly URL, when using Nginx as the web server - no apache.
Thanks!

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: Fiendly URLs for Nginx

Post by tuffadmin » Sun Oct 25, 2015 6:33 pm

This is a config straight from my own setup

server {

listen 80;
listen [::]:80;
root /var/www/; #change to your document root
server_name yourdomain.com ;
index index.php index.html index.htm ;

location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
add_header "Access-Control-Allow-Origin" "*";
expires 1y;
access_log off;
add_header Cache-Control "public";
}

# Feed
location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control "public";
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}

location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}

# pass requests for dynamic content to site

location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {

try_files $uri /index.php;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_hide_header X-Powered-By;
}

location ~ /\.ht {
deny all;
}


}


It will add support for permalink and add caching headers for static files.
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

steve
Senior
Posts: 222
Joined: Thu Oct 01, 2015 5:33 pm
Has thanked: 11 times
Been thanked: 4 times

Re: Fiendly URLs for Nginx

Post by steve » Wed Apr 06, 2016 6:12 pm

Hello Navjot,
Some parts in your configuration shows a cache of 1 yr (1 year). Does this mean that if i make any changes to the css or modify that particular image.. my users will not be able to see the changes for a year??

Thanks

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: Fiendly URLs for Nginx

Post by tuffadmin » Fri Apr 08, 2016 3:26 am

steve wrote:Hello Navjot,
Some parts in your configuration shows a cache of 1 yr (1 year). Does this mean that if i make any changes to the css or modify that particular image.. my users will not be able to see the changes for a year??

Thanks
It should work but It does not happen in real world, because browser invalidate cache very often.
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

Locked