GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech Roboscripts Nginx conf (https://gfy.com/showthread.php?t=1381322)

Freedoom 01-22-2025 05:28 AM

Roboscripts Nginx conf
 
Hello,

I still have some sites running with robot scripts, and I have moved to a new server, but for some reason, the performer's page and tags aren't working. When I click on the models, it just shows me the index page, not the performer page. Same thing with the tags.

Does anyone have any working nginx conf? Or anyone knows how to fix my config?
Thanks

Edit: I forgot to mention that my performer's page is like this: https://domain.com/user/performersname/
And tags are: https://domain.com/tag/anal/

This is my conf:

Code:

server {
          listen 80;
      listen 443;
      server_name domain.com www.domain.com;
          access_log /var/log/nginx/domain.com.log combined;
          error_log /var/log/nginx/domain.com.error_log warn;
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
      root /home/httpd/html/domain.com/public_html;
          index index.php;

location ~ /.well-known { root /var/www; allow all; }

rewrite ^/user/(.*)$ /user/index.php?url=$1;

rewrite ^/page/(.*)$ /index.php;
rewrite ^/category/(.*)$ /index.php;

rewrite ^/tag/(.*)$ /./tag/index.php?url=$1;
rewrite ^/sitemap_index\.xml$ /./sitemap/cb.sitemap_index.php?id=1 last;
rewrite ^/sitemap\.xml(.*)$ /./sitemap/cb.sitemap_page.php?$query_string last;

location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gz|gzip|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip|png|jpg|jpeg|gif|ico|js|css)$ {
            expires max;
            access_log off;
            log_not_found off;
            add_header Vary Accept-Encoding;
            add_header Pragma public;
            add_header Cache-Control "max-age=31536000, public";
            etag off;
}



location ~ /\. { deny all; }


location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass php56-fpm;
                fastcgi_index index.php;
                fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
                fastcgi_read_timeout 1200;
                fastcgi_max_temp_file_size 0;
                fastcgi_buffer_size 4K;
                fastcgi_buffers 64 4k;

                }

}


Freedom6995 01-24-2025 03:19 PM

I asked: do you see any errors in this code?

Answer:

Yes, there are several issues and improvements that can be made to this Nginx configuration:

1. **Port 443 and SSL Configuration Missing `ssl` Directive:**
- When listening on port 443, SSL should be explicitly enabled with the `ssl` directive:
```nginx
listen 443 ssl;
```

2. **Mixed Configuration Directive Styles:**
- It's better to separate and organize your configurations for port 80 and 443 for clarity, especially if you implement HTTP to HTTPS redirection.

3. **Potential Overuse of `rewrite`:**
- Some usages of `rewrite` may not require the complexity it introduces. Consider using `location` blocks and `try_files` if suitable for static redirects.

4. **Multiple Rewrite Issues:**
- Ensure that the rewrite rules make sense logically and syntactically. There are potential issues, like `rewrite ^/tag/(.*)$ /./tag/index.php?url=$1;` where `./` may be unintended.
- Rewrites can be performance-heavy; evaluate if they are all necessary or if there could be a more efficient way to handle routing.

5. **File Type Regex Pattern:**
- The exhaustive list of file extensions may include some unnecessary ones, and using them in a single regex pattern can slow down request processing. Consider simplifying this or breaking it into multiple `location` blocks if needed.

6. **Denial of Access to Hidden Files:**
- The `location ~ /\. { deny all; }` block can protect hidden files (those starting with a dot), but this block might overlap with the `.well-known` location. Value specificity in location matching.

7. **Misconfigured ETag:**
- `etag off;` isn't a default directive. It's generally managed via `etag` or `add_header ETag $etag;`.

8. **`fastcgi_pass`:**
- This directive assumes you have a PHP-FPM upstream named `php56-fpm`. Ensure your upstream is correctly configured or using a socket path.

9. **Server-wide or Location-based Security Headers:**
- Consider adding basic security headers such as `Strict-Transport-Security` (HSTS), `X-Content-Type-Options`, `X-Frame-Options`, or `Content-Security-Policy` if relevant to your application needs.

10. **`access_log off;` Directive:**
- Turning off logging can help with performance but should be used judiciously to aid in debugging when needed.

Freedom6995 01-24-2025 03:20 PM

this was the code it spit out:

Code:

server {
    listen 80;
    server_name domain.com www.domain.com;
   
    # Redirect all HTTP to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name domain.com www.domain.com;
   
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
   
    root /home/httpd/html/domain.com/public_html;
    index index.php;

    access_log /var/log/nginx/domain.com.log combined;
    error_log /var/log/nginx/domain.com.error_log warn;

    location ~ /.well-known {
        root /var/www;
        allow all;
    }

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

    # Example for static content caching
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf)$ {
        expires max;
        log_not_found off;
        add_header Cache-Control "public";
    }

    location ~ /\. {
        deny all;
    }

    location ~ \.php$ {
        fastcgi_pass php56-fpm;  # Ensure the upstream here matches your PHP-FPM configuration
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}


Shoplifter 01-24-2025 03:43 PM

Did you update Yoast?

This was the problem we saw with newer versions of Yoast.

Freedoom 01-24-2025 06:04 PM

Quote:

Originally Posted by Shoplifter (Post 23340986)
Did you update Yoast?

This was the problem we saw with newer versions of Yoast.

It was the php version of roboscripts not the WP version.

Its fixed now. Thanks


All times are GMT -7. The time now is 01:19 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc