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

Nginx configuration in linux, need help #1026

Open
NetLancer opened this issue Aug 10, 2023 · 3 comments
Open

Nginx configuration in linux, need help #1026

NetLancer opened this issue Aug 10, 2023 · 3 comments

Comments

@NetLancer
Copy link

Sorry, must confess i'm not very good at nginx and server configuring, and here's my /etc/nginx/sites-available/my-site file edited in accordance to github.com/microweber/microweber#nginx
-where apart from two location directives mentioned, the default configuration contains
location ~ \.php$ { include snippets/fastcgi-php.conf; # With php-fpm (or other unix sockets): fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # With php-cgi (or other tcp sockets): fastcgi_pass 127.0.0.1:9000; }
which i commented out and added the following one instead (from some inet article, the freshest i could afford to find)))
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
Again, i'm not sure what it really does, but, pleeease give me the clue where i'm wrong and what to amend to make the site work. Currently it just displays blank page, no errors shown..
I have zorin os 16.3 and nginx/php8.2 installed from from repo + ppa

@NetLancer NetLancer changed the title Nginx configuration in linux Nginx configuration in linux, need help Aug 10, 2023
@NetLancer
Copy link
Author

Frankly i've been trying it out to work for quite a bit, no success :(.
Although other test *.php scripts i put in base installation folder work ok when navigated to ..
Has it been tested on ubuntu lts/nginx environment or what am i missing ?

@peter-mw
Copy link
Member

hi, you must put the rewrite rules in nginx

For example

server {
  location / {
    try_files $uri $uri/ /index.php$is_args$args;
  }
  location ~ /(vendor|src|config|storage|.git|.env) {
   deny all;
   return 404;
 }
}


@NetLancer
Copy link
Author

Thank you, i wish this was included in the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants