HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Redirect Loop on Vanilla 3.3 / Nginx

Hello,

I am trying to set up vanilla for the first time and I think I might be in over my head. I followed the guide here, but when I visit it in my web browser I get in a 302 redirect loop to /dashboard/setup.

I am not quite sure I might be doing different, as far as I can tell my nginx configuration matches the nginx configuration provided. I am happy to post any information that would help.

Comments

  • Options
    BleistivtBleistivt Moderator

    Please post your nginx configuration and the path where your forums index.php is.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Here's my working nginx configuration and as you can see, I tried several things before I got it working. The unforeseen error I faced was that adding RewriteUrls = true to the config. The config below was enough to have pretty urls right from the start


    server {
           listen 80;
           server_name develop.vanilla.loc;
    
           root /home/rj/Develop/www/vanilla/develop;
    
       index index.php;
    
       # Block some folders as an extra hardening measure.
       location ~* /\.git { deny all; return 403; }
       location /build/ { deny all; return 403; }
       location /cache/ { deny all; return 403; }
       location /cgi-bin/ { deny all; return 403; }
       location /uploads/import/ { deny all; return 403; }
       location /conf/ { deny all; return 403; }
       location /tests/ { deny all; return 403; }
       location /vendor/ { deny all; return 403; }
    
       # This handles all the main requests thru index.php.
       location ~* ^/index\.php(/|$) {
           # send to fastcgi
           include fastcgi.conf;
           # fastcgi_param SCRIPT_NAME /index.php;
           # fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
    
    fastcgi_split_path_info      ^(.+\.php)(.*)$;
    # fastcgi_param SCRIPT_FILENAME /path/to/php$fastcgi_script_name;
    # fastcgi_param SCRIPT_NAME /index.php;
           fastcgi_param SCRIPT_NAME /index.php;
           fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
    fastcgi_param PATH_INFO      $fastcgi_path_info;
    
           fastcgi_param X_REWRITE 1;
                   fastcgi_pass unix:/run/php/php7.4-fpm.sock;
       }
       # If this is some other PHP script, disallow it by redirecting to /index.php
       location ~* \.php(/|$) {
           rewrite ^ /index.php$uri last;
       }
    
       # Default path handling
       location / {
           try_files $uri @vanilla;
       }
    
       location @vanilla {
           rewrite ^ /index.php$uri last;
       }
    
    }
    


Sign In or Register to comment.