Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration for nginx #12

Open
howardlshippin opened this issue May 31, 2022 · 1 comment
Open

configuration for nginx #12

howardlshippin opened this issue May 31, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@howardlshippin
Copy link

It would be useful to include in the documentation the configuration for nginx (i.e. the equivalent entry to include in the sites-enabled default file, which I understood should include the rewrite information instead of the .htaccess file used by apache).

Being new to this, I used an online converter, which gave me the following:

nginx configuration by winginx.com

location ~ ^/photos/nova-config/.*$ { }

location ~ ^/photos/nova-base/.*$ { }

location ~ ^/photos/nova-languages/.*$ { }

location /photos/ {
if (!-e $request_filename){
rewrite ^/photos/(.*) /photos/index.php break;
}
}

I included the above in the NGINX default file of the sites-enabled diectory, however it doesn't work. (I get a 403 Forbidden error when trying to access the photos directory). PHP itself is set up correctly, according to tests, and the php.info file loads OK under NGINX.

@david-novafacile
Copy link
Contributor

Good point! The difficulty is that nginx server configuration must always be customized to your own server environment and own requirements.

Here an example of nginx configuration on Ubuntu 20.04:

server {
        listen 80;
        listen [::]:80;
        server_name mydomain.com;
        root /www/novagallery;
        index index.php;

        location / {
                try_files $uri $uri/ /index.php?$args;
        }
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }
        location ^~ /nova-config/ { deny all; }
        location ^~ /nova-base/ { deny all; }
        location ^~ /nova-languages/ { deny all; }
}

If you have novaGallery installed in a subfolder, then you need to adjust the paths.

@david-novafacile david-novafacile self-assigned this Jun 1, 2022
@david-novafacile david-novafacile added the documentation Improvements or additions to documentation label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants