0

I have Nginx installed and i want to config the forum.

The url EXAMPLE: example.com Forum phpbb3 Access : example.com Another web into the same domain: example.com/web Nginx forum path /var/www/html/foro (example.com) Nginx web path /var/www/html/web (example.com/web)

I created the Nginx configuration, but only let me to access to example.com, if i put example.com/web or example.com/{whatever you like}, automaticaly redirect to example.com, so i dont know where is redirecting me allways to example.com. The forum works fine, but i need to take away the redirection just to access to example.com/web, without any problem

Anyoane can help me with this configuration?

    # Remove www domain prefix.
server {
        listen 80;
        # IPv6
        listen [::]:80;

        return 301 $scheme://example.com$request_uri;                      # change /etc/hosts file with the ip and phpbb-test-mysite.com
}

# Board configuration.
server {
        listen 80;
        # IPv6
        listen [::]:80;
        server_name example.com;
        root /var/www/html/foro;

        # phpBB uses index.htm
        index index.php index.html index.htm;

        # Loggers
        error_log /var/log/nginx/phpbb.error.log warn;
        access_log /var/log/nginx/phpbb.access.log;
        location / {
        try_files $uri $uri/ @rewriteapp;

                # Pass the php scripts to FastCGI server specified in upstream declaration.
                location ~ \.php(/|$) {
                        include fastcgi.conf;
                        fastcgi_split_path_info ^(.+\.php)(/.*)$;
                        fastcgi_param PATH_INFO $fastcgi_path_info;
                        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
                        fastcgi_param DOCUMENT_ROOT $realpath_root;
                        try_files $uri $uri/ /app.php$is_args$args;
                        fastcgi_pass php;
                }

                # Deny access to internal phpbb files.
                location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor) {
                        deny all;
                        # deny was ignored before 0.8.40 for connections over IPv6.
                        # Use internal directive to prohibit access on older versions.
                        internal;
                }
        }

        location @rewriteapp {
                rewrite ^(.*)$ /app.php/$1 last;
        }

        # Correctly pass scripts for installer
        location /install/ {
                try_files $uri $uri/ @rewrite_installapp =404;

                # Pass the php scripts to fastcgi server specified in upstream declaration.
                location ~ \.php(/|$) {
                        include fastcgi.conf;
                        fastcgi_split_path_info ^(.+\.php)(/.*)$;
                        fastcgi_param PATH_INFO $fastcgi_path_info;
                        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
                        fastcgi_param DOCUMENT_ROOT $realpath_root;
                        try_files $uri $uri/ /install/app.php$is_args$args =404;
                        fastcgi_pass php;
                }
        }
        location @rewrite_installapp {
                rewrite ^(.*)$ install/app.php/$1 last;
        }

        # Deny access to version control system directories.
        location ~ /\.svn|/\.git {
                deny all;
                internal;
        }
}

0

You must log in to answer this question.

Browse other questions tagged .