My Website Vistit used Joomla 3, How to Config mod Rewrite? @eva2000 Thanks
unfortunately never used Joomla 3 so i wouldn't know the specifics, but it's like any other web app and Centmin Mod. Just find a working Nginx example for your web app (Joomla 3) and weave in the settings into Centmin Mod vhost's template format. You can see examples at http://centminmod.com/nginx_configure.html particularly how i took IP.Board's example Nginx config and wove it into Centmin Mod Nginx format at http://centminmod.com/nginx_configure_ipboard.html or ownCloud example of taking the official config for Nginx at http://doc.owncloud.org/server/6.0/.../installation_source.html#nginx-configuration and weaving it into Centmin Mod Nginx format https://community.centminmod.com/resources/how-to-install-owncloud-on-centmin-mod-nginx.1/
i have config same you help, it cannot run I have config this i my Site, it working, but it do not optimize. Please Help Me @eva2000 Code: server { listen 80; server_name www.ctsc.vn; return 301 http://ctsc.vn$request_uri; } server { server_name ctsc.vn; server_name_in_redirect off; # ngx_pagespeed & ngx_pagespeed handler #include /usr/local/nginx/conf/pagespeed.conf; #include /usr/local/nginx/conf/pagespeedhandler.conf; #include /usr/local/nginx/conf/pagespeedstatslog.conf; # limit_conn limit_per_ip 16; #ssi on; access_log /home/nginx/domains/ctsc.vn/log/access.log combined buffer=32k; error_log /home/nginx/domains/ctsc.vn/log/error.log; root /home/nginx/domains/ctsc.vn/public; location / { # block common exploits, sql injections etc #include /usr/local/nginx/conf/block.conf; # Enables directory listings when index file not found #autoindex on; # Shows file listing times as local time #autoindex_localtime on; # Enable for vBulletin usage WITHOUT vbSEO installed #try_files / /index.php; try_files $uri $uri/ /index.php?q=$request_uri; } #pass php files to fastcgi location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /usr/local/nginx/conf/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #set expires to 0 to stop caching of php files expires 0; } location ~ ^/ { #set expires to 30d to cache static files expires 30d; #file doesn't exist, will need to be sent to php if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } } # caching of files location ~* \.(ico|pdf|flv)$ { expires 1y; } location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ { expires 14d; } include /usr/local/nginx/conf/staticfiles.conf; include /usr/local/nginx/conf/php.conf; include /usr/local/nginx/conf/drop.conf; #include /usr/local/nginx/conf/errorpage.conf; } Steps Check Error: Step 1: Click: http://ctsc.vn/gioi-thieu/y-kien-khach-hang.html (image in Right colum display the right) Step 2: Windows: Ctrl + F5 (Reload Web) Step 3: Error: Image not show ------- Note: In Step 1: Image Drirectory URL: http://ctsc.vn/images/ In Step 3: Image Drirectory URL: http://ctsc.vn/gioi-thieu/images/ My Customer used mod K2 Content off Joomla 3
only thing i see is you have duplicated the php location as this is not needed Code: #pass php files to fastcgi location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /usr/local/nginx/conf/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #set expires to 0 to stop caching of php files expires 0; } as Centmin Mod takes care of that in the include file php.conf Code: include /usr/local/nginx/conf/php.conf; also these lines are duplicated Code: # caching of files location ~* \.(ico|pdf|flv)$ { expires 1y; } location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ { expires 14d; } as they are taken care of by staticfiles.conf include file Code: include /usr/local/nginx/conf/staticfiles.conf;
unfortunately as i never used Joomla can't help but best to check your error logs and see as well https://community.centminmod.com/threads/where-are-the-log-files-located.595/ FAQ 19 at http://centminmod.com/faq.html
But a quick check at http://docs.joomla.org/Nginx#Configure_Nginx shows your vhost needs some changes IF the official doc config is working for Joomla 3 Code: server { listen 80; server_name www.ctsc.vn; return 301 http://ctsc.vn$request_uri; } server { server_name ctsc.vn; server_name_in_redirect off; # ngx_pagespeed & ngx_pagespeed handler #include /usr/local/nginx/conf/pagespeed.conf; #include /usr/local/nginx/conf/pagespeedhandler.conf; #include /usr/local/nginx/conf/pagespeedstatslog.conf; # limit_conn limit_per_ip 16; #ssi on; access_log /home/nginx/domains/ctsc.vn/log/access.log combined buffer=32k; error_log /home/nginx/domains/ctsc.vn/log/error.log; root /home/nginx/domains/ctsc.vn/public; location / { # block common exploits, sql injections etc #include /usr/local/nginx/conf/block.conf; # Enables directory listings when index file not found #autoindex on; try_files $uri $uri/ /index.php?$args; } # deny running scripts inside writable directories location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { return 403; error_page 403 /403_error.html; } include /usr/local/nginx/conf/staticfiles.conf; include /usr/local/nginx/conf/php.conf; include /usr/local/nginx/conf/drop.conf; #include /usr/local/nginx/conf/errorpage.conf; }
that is because you configured Joomla to server .html files via PHP and not Nginx as static files to work around that 404 remove or comment out html location in staticfiles.conf include at /usr/local/nginx/conf/staticfiles.conf and restart nginx FYI, serving .html via PHP reduces performance compared to via Nginx
I have delete it in staticfiles.conf, it wotking, but when Ctrl + F5, image have not show same: https://community.centminmod.com/threads/how-to-config-rewrite-in-joomla-3.659/#post-3005
you probably have style image reference error so need to look at that Code: Request URL:http://ctsc.vn/gioi-thieu/images/banners/download.gif Request Method:GET Status Code:404 Not Found i assume the correct url would be Code: http://ctsc.vn/images/banners/download.gif
looks like that is the case, incorrectly referenced html HTML: <img src="images/banners/download.gif" alt="Download Phần mềm Dự toán CT">
The problem is the relative reference to the current directory for your images as opposed to to root of your site incorrect Code: images/banners/download.gif correct Code: /images/banners/download.gif nothing to do with web server used