Focus on cloud service provider activities
Notes on website operation and maintenance

Pseudo static Setting Method of Joomla Program in LNMP/Nginx Environment

In the previous article“ Pseudo static Solution of WordPress Program in LNMP Environment "We have learned how to Nginx environment Set the pseudo static method of wordpress under, because Nginx is different from Apache in that it throws one directly HTACCESS is so simple that it needs to be set manually. Among our common CMS programs, Joomla is also a very good content management system, and its security is much better than our familiar DEDECMS. In addition, the pseudo static path can save our space resources.

The first step is to prepare the pseudo static script.

 server { listen 80; server_name laozuo.org; server_name_in_redirect off; access_log /var/log/nginx/localhost.access_log main; error_log /var/log/nginx/localhost.error_log info; root PATH_ON_SERVER; index index.php index.html index.htm default.html default.htm; # Support Clean (aka Search Engine Friendly) URLs location / { 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; } location ~ \.php$ { fastcgi_pass  127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi.conf; } # caching of files  location ~* \.(ico|pdf|flv)$ { expires 1y; } location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ { expires 14d; } }

The domain name above needs to be written as our own.

Step 2: Modify the file.

/usr/local/nginx/conf/vhost/www.laozuo.org.conf

This file is automatically generated when we add a domain name site, and then modify this script to a pseudo static file in the first step. Replace all of them. In this way, we write all the pseudo statics instead of calling them like WordPress. The effect is the same.

Finally, after the modification, we need to restart LNMP.

/root/lnmp restart

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Pseudo static Setting Method of Joomla Program in LNMP/Nginx Environment


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge