Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Error in nginx configuration

$
0
0
Hello everyone, I am just starting my way to NGINX and I need a pro answer. There is CentOS7 on which GLPI + Nginx is installed. Everything seems to work without problems, but I encountered such a problem that you need to work with the GLPI API and there is a jamb, based on the documentation for the GLPI API, the URL is accessed by the following http: //MyWebGLPI/apirest.php/, when navigating through this link I get 404 Not Foung nginx (in the logs there is the following entry: 2020/06/22 10:32:09 [error] 10309 # 10309: * 15 "/var/www/glpi/apirest.php/index.php" is not found (20: Not a directory), client: xxxx, server: MyWebGLP, request: "GET /apirest.php/ HTTP / 1.1", host: "MyWebGLP") That is, he thinks that I want to go through the directory and this is a clear error in the configuration file, BUT, if you remove "/" from the URL and the link looks like this: http: //MyWebGLPI/apirest.php, then everything works out as it should, but this is not correct. Here is the configuration file, what is the error?

### support.sevo44.ru
server {
listen 80;
listen [::]:80;


root /var/www/glpi/;
index index.php index.html index.htm;

access_log /var/www/glpi/log/access.log;
error_log /var/www/glpi/log/error.log;

# Include phpmyadmin
#include /etc/nginx/snippets/phpMyAdmin.conf;


set_real_ip_from 10.0.0.0/8;
real_ip_header X-Real-IP;


client_max_body_size 10m;

keepalive_timeout 60;
add_header Strict-Transport-Security 'max-age=604800';

location / {
try_files $uri =404;
autoindex on;
}

location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico|woff)$ {
access_log off;
expires max;
}

location /api {
rewrite ^/api/(.*)$ /apirest.php/$1 last;
}

location ~ \.php$ {
try_files $uri = 404;
fastcgi_index index.php;
fastcgi_pass unix:/run/php-fpm/MyWebGLPI.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
fastcgi_param HTTPS on;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_param PHP_VALUE "
memory_limit = 64M
file_uploads = on
max_execution_time = 600
session.auto_start = off
session.use_trans_sid = 0
";
}

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
#allow all;
deny all;
log_not_found off;
access_log off;
}

location ~ /\.ht {
deny all;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>