Dear Forum,
Please assist me in an issue I'm having with an old website made with Codeigniter. From the code I've found out, the codeigniters CI_VERSION is 2.0.2 and it is a website ment to be a facebook app.
I've set up the database with a user and imported the old data into it.
The server specifications are:
The PHP is running on port 9000 and since I have mupltiple websites activated on this server I know it is working properly.
Here is my NginX configuration. Please note that the part of port 80, is not really relevant since the site automaticly get's forwarded to https (I have no idea how, probably in the websites code since it is a Facebook app, it needs to run on https.)
In terminal if I call the main index.php then I can see the code of the site I wish to see. However in browsers I get 403 Forbidden error messages. Log from NginX file is:
I get the same error message even if I give 777 recursive to the folder. The files are owned by the right user to be accessable by anyone coming from browser (so the same for all websites)
Can you help me out by asking for file codes? I don't know Codeigniter and I don't know where to start looking.
Thank you in advance!
Bert
Please assist me in an issue I'm having with an old website made with Codeigniter. From the code I've found out, the codeigniters CI_VERSION is 2.0.2 and it is a website ment to be a facebook app.
I've set up the database with a user and imported the old data into it.
The server specifications are:
- Nginx: 1.8.0
- PHP + PHP-FPM: 5.6.20
- MySQL: 5.7.15
The PHP is running on port 9000 and since I have mupltiple websites activated on this server I know it is working properly.
Here is my NginX configuration. Please note that the part of port 80, is not really relevant since the site automaticly get's forwarded to https (I have no idea how, probably in the websites code since it is a Facebook app, it needs to run on https.)
Code:
server {
listen 80;
server_name website.company.hu;
root /var/www/hu.company.website;
index index.php;
access_log /var/log/nginx/hu.company.website/access-80.log;
error_log /var/log/nginx/hu.company.website/error-80.log debug;
location / {
try_files $uri /index.php/$args;
}
location ~ /index.php/ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
include fastcgi_params;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
access_log off;
log_not_found off;
}
}
server {
listen 443 ssl;
server_name website.company.hu;
ssl_certificate /etc/nginx/ssl/company.hu.combined.crt;
ssl_certificate_key /etc/nginx/ssl/company.hu.key;
root /var/www/hu.company.website;
error_log /var/log/nginx/hu.company.website/error-443.log debug;
access_log /var/log/nginx/hu.company.website/access-443.log;
index index.html index.htm index.pl;
rewrite ^/index\.php?(.*)$ /$1 permanent;
location / {
root /var/www/hu.company.website;
index index.html index.htm index.pl;
try_files $uri $uri/ /index.php;
}
location @rewrite {
rewrite ^(.*)$ /index.php/$1 last;
}
location ~ ^/index.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
access_log off;
log_not_found off;
}
}In terminal if I call the main index.php then I can see the code of the site I wish to see. However in browsers I get 403 Forbidden error messages. Log from NginX file is:
Code:
==> /var/log/nginx/hu.company.website/error-443.log <==
2017/02/08 17:06:39 [notice] 20108#0: *8 "^/index\.php?(.*)$" does not match "/", client: XX.XXX.XXX.XXX, server: website.company.hu, request: "GET / HTTP/1.1", host: "website.company.hu"
2017/02/08 17:06:39 [error] 20108#0: *8 directory index of "/var/www/hu.company.website/" is forbidden, client: XX.XXX.XXX.XXX, server: website.company.hu, request: "GET / HTTP/1.1", host: "website.company.hu"
==> /var/log/nginx/hu.company.website/access-443.log <==
XX.XXX.XXX.XXX - - [08/Feb/2017:17:06:39 +0100] "GET / HTTP/1.1" 403 570 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"I get the same error message even if I give 777 recursive to the folder. The files are owned by the right user to be accessable by anyone coming from browser (so the same for all websites)
Can you help me out by asking for file codes? I don't know Codeigniter and I don't know where to start looking.
Thank you in advance!
Bert