Welcome! Log In Create A New Profile

Advanced

Wordpress url prefix nginx Subdomain / Subfolder

Posted by raha.ab 
Wordpress url prefix nginx Subdomain / Subfolder
August 18, 2021 03:23PM
Hi
I'm runing Nginx in Webmi/Virtualmin server
I read more about configuration for URL Prefix and Now I'm confusing ...
Would you please read?

1-What is different between these to lines? I copied the first one from this link https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/

try_files $uri $uri/ /index.php?$args;
try_files $uri $fastcgi_script_name =404;

2-I want to add nginx config for my subdomain , because now I have only main page of WordPress of website and want to see other pages , in your default configuration is like this :

server {server_name blog.virtualmin.com www.blog.virtualmin.com;
listen my ip v4;
root /home/webmin/domains/blog.virtualmin.com/public_html;
index index.php index.htm index.html;
access_log /var/log/virtualmin/blog.virtualmin.com_access_log;
error_log /var/log/virtualmin/blog.virtualmin.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/webmin/domains/blog.virtualmin.com/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/webmin/domains/blog.virtualmin.com/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
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 PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS $https;
location ~ \.php(/|$) {
try_files $uri $fastcgi_script_name =404;
fastcgi_pass unix:/var/php-nginx/162886556426955.sock/socket;
}
fastcgi_split_path_info ^(.+\.php)(/.+)$;
listen my ip v4:443 ssl;
ssl_certificate /home/webmin/domains/blog.virtualmin.com/ssl.combined;
ssl_certificate_key /home/webmin/domains/blog.virtualmin.com/ssl.key;
fastcgi_read_timeout 60;
}

And I add these 2lines from the link of my first question

location /home/webmin/domains/blog.virtualmin.com {
try_files $uri $uri/ /home/webmin/domains/blog.virtualmin.com/index.php?$args;
}

location ~ \.php$ {
fastcgi_split_path_info ^(/home/webmin/domains/blog.virtualmin.com)(/.*)$;
}

And also I change the url of those links in many way, but it didn’t worked.
Would you please tell me what should I do for that ?

3-How add permalink for my subfolder inside the root folder of wordpress ? I was restored my website from Cpanel to Wbemin/Virtualmin powerful panel and all urls

Thanks to Nginx Developers and support team for this amazing Webserver that can compit the Lightspeed.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready