HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/nginx/ivenusin-php.conf
                set $has_args '';
                set_by_lua $request_uri_without_args 'return string.gsub(ngx.var.request_uri, "?.*", "")';

                set_by_lua $cleaned_args '
                        local whitelist = { "relatedposts" ,"wp-json", "p", "q", "s", "wc-api", "wc-ajax" }
                        local args, err = ngx.req.get_uri_args()
                        local c_args = {}

                        for arg, arg_value in pairs(args) do
                                  for _, whitelisted_arg in ipairs(whitelist) do
                                          if arg == whitelisted_arg then
                                                  if type(args[whitelisted_arg]) ~= "boolean" then
                                                          table.insert(c_args, arg .. "=" .. args[whitelisted_arg])
                                                          ngx.var.has_args = "?"
                                                  else
                                                          table.insert(c_args, arg)
                                                          ngx.var.has_args = "?"
                                                  end
                                          end
                                  end
                          end

                        return table.concat(c_args, "&")
                ';


                set $key "nginx-cache:https$request_method$host$request_uri_without_args$has_args$cleaned_args";

#START Nginx Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
# END Nginx Rewrites for Rank Math Sitemaps