Roboscripts Nginx conf

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Freedoom
    Confirmed User
    • Feb 2006
    • 2811

    #1

    Tech 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;
    
                    }
    
    }
    Last edited by Freedoom; 01-22-2025, 03:37 AM. Reason: added more information
    List Of Sex Cams
  • Freedom6995
    Friends of Venus founder
    • Jul 2010
    • 1975

    #2
    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.

    Comment

    • Freedom6995
      Friends of Venus founder
      • Jul 2010
      • 1975

      #3
      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;
          }
      }

      Comment

      • Shoplifter
        Richest man in Babylon
        • Jan 2002
        • 5845

        #4
        Did you update Yoast?

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

        Comment

        • Freedoom
          Confirmed User
          • Feb 2006
          • 2811

          #5
          Originally posted by Shoplifter
          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
          List Of Sex Cams

          Comment

          Working...