eckmar-community / eckmar

Open-source marketplace on Laravel (PHP). Also known as the Eckmar's Marketplace Script.
104 stars 61 forks source link

Nginx Config and give the files and folders permission #90

Closed pacino01 closed 11 months ago

pacino01 commented 11 months ago

Hello, I edited the config and after I want to check Nginx with: sudo nginx -t I got this output: nginx: [emerg] "server_name" directive is not allowed here in /etc/nginx/sites-enabled/default:60 nginx: configuration file /etc/nginx/nginx.conf test failed

After I installed the file I have a problem to give them permission, maybe its a problem because of nginx config is not working correctly?

knulii commented 11 months ago

Delete everything in /etc/nginx/sites-enabled/default and paste:

server { listen 80; listen [::]:80; listen 443; listen [::]:443; root /var/www/eckmar/public; index index.php index.html index.htm index.nginx-debian.html; server_name domain.com; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ .php$ { try_files $uri =404; fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

https://github.com/eckmarcommunity/eckmar/blob/master/INSTALLATION.md#nginx-config

pacino01 commented 11 months ago

Delete everything in /etc/nginx/sites-enabled/default and paste:

server { listen 80; listen [::]:80; listen 443; listen [::]:443; root /var/www/eckmar/public; index index.php index.html index.htm index.nginx-debian.html; server_name domain.com; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ .php$ { try_files $uri =404; fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

https://github.com/eckmarcommunity/eckmar/blob/master/INSTALLATION.md#nginx-config

I pasted the settings into: nano /etc/nginx/sites-available/default and after sudo nginx -t I got this response: nginx: [emerg] "server_name" directive is not allowed here in /etc/nginx/sites-enabled/default:60 nginx: configuration file /etc/nginx/nginx.conf test failed

knulii commented 11 months ago

You need to delete everything in the file default THEN paste. The error you have is on line 60. there are only 14 lines to paste