Comments (19)
Just in case anyone has issues still ( I did today ), the following nginx config worked for me:
server {
listen 80;
server_name _ myCockpit.com;
root /var/www/html/cockpit-master;
index index.php;
location / {
try_files $uri $uri/ /index.php;
}
access_log /var/log/nginx/cockpit.access.log;
error_log /var/log/nginx/cockpit.error.log;
# Deny direct access to .sqlite
location ~ .sqlite$ {
deny all;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param COCKPIT_URL_REWRITE On;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
from cockpit.
It seems that $_SERVER['PATH_INFO'] is missing....maybe this site might help: http://wiki.nginx.org/PHPFcgiExample
from cockpit.
Hi, same issue but i have this line, any idea ?
from cockpit.
Same here. Install worked, but I can't get past that.
from cockpit.
does this information help?
http://stackoverflow.com/questions/15316742/nginx-configuration-php-frameworks-with-pathinfo-404
I'll try to setup a nginx env in the next days to replicate the issue.
from cockpit.
Unfortunately I didn't have any luck with the suggestions in that Stack Overflow thread. But I'm anxious to see what you find!
from cockpit.
I updated the cockpit code and would appreciate it if you could test it. Please download the latest master:
https://github.com/aheinze/cockpit/archive/master.zip
and add the following rule to your server config:
location /cockpit {
try_files $uri $uri/ /cockpit/index.php;
}
change cockpit
to the folder name you extracted the cockpit zip.
Thanks for testing and feedback!
from cockpit.
Hi, no change for me :(
from cockpit.
could you please provide you server config?
from cockpit.
Same here.
I get redirected to "install" an then nothing :(
from cockpit.
http://example.com/cockpit/install works fine and i get redirected to http://example.coom/cockpit which results in an 404. Adding index.php doesn't help, but adding a trailing slash works.
http://example.com/cockpit -- doesn't work
http://example.com/cockpit/index.php -- doesn't work
http://example.com/cockpit/index.php/ -- works
from cockpit.
Same issue as above,
server {
listen cockpit:80;
server_name cockpit;
access_log /var/log/nginx/cockpit.access.log;
error_log /var/log/nginx/cockpit.error.log;
root /srv/cockpit;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php;
}
location ~ .sqlite$ {
deny all;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
include fcgi.conf;
fastcgi_pass unix:/var/run/php-fcgi-cockpit-php-fcgi-2.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
from cockpit.
I've the same problem, partially solved with this :
- verify that all "fastcgi_param" are set
PATH_INFO, REQUEST_URI, PHP_SELF in priority (used in the index.php). For others params see http://wiki.nginx.org/PHPFcgiExample. - Fix fastcgi path_info
location ~ [^/]\.php(/|$) {
...
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
...
}
Now, if i get index.php/auth/login, it works !!!
The last problem i have : if i go to the index.php before being logged, cockpit does not redirect to the login page.
from cockpit.
Just for everyone's info...
PATH_INFO
has always been broken on nginx, and it doesn't look like it will be fixed anytime soon, as apparently it is an outdated concept :(
Is there any way that cockpit can be updated to do without this server var?
from cockpit.
@designermonkey PATH_INFO dependency is now removed in the current release
from cockpit.
Thanks :)
from cockpit.
I had the same issue with the following config:
server {
listen 80;
server_name cockpit.dev;
root /usr/share/nginx/html/cockpit;
index index.php index.html index.htm;
error_log /var/log/nginx/cockpit_error.log.txt;
access_log /var/log/nginx/cockpit_access.log.txt;
# Add additional types
include mime.types;
location / {
index index.php index.html index.htm;
}
# Change "cockpit" to the folder name containing cockpit files.
location /cockpit {
try_files $uri $uri/ /cockpit/index.php;
index index.php index.html index.htm;
}
location ~ \.php(/|\?|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param COCKPIT_URL_REWRITE On;
include fastcgi_params;
}
location ~ .sqlite$ {
deny all;
}
}
And the file structure is
/www(root)/cockpit/*
error log is
"/usr/share/nginx/html/cockpit/auth/login" failed (2: No such file or directory), client: 121.121.121.1, server: cockpit.dev, request: "GET /auth/login HTTP/1.1", host: "cockpit.dev"
from cockpit.
nginx sample config available here: https://github.com/aheinze/cockpit-docs/blob/master/tutorials/nginx.md
from cockpit.
Thank you, lhardie. You're a life saver! I was trying it for the whole day and was always running into the same problem.
Cockpit's documentation strongly needs more detailed installation instructions in this regard.
It seems that the crucial part is the following line:
try_files $uri $uri/ /index.php;
from cockpit.
Related Issues (20)
- fitToHeight not working same as fitToWidth (Image API)
- #[\\ReturnTypeWillChange] Deprecation Error
- Screen Lock Login HOT 1
- Bug: The order of nested layout modules reverts back to the first saved state on the second save.
- [Recommendation] Documentation is preparing.
- cms date gte
- PHP version requirment is 7.1 or 7.3? HOT 2
- Can I global disable the finder? HOT 1
- Is there a way to restrict assets folder per group?
- Apache userdir wrong redirect
- Linked items: Collection entry must contain a "name"-field
- placeholder (null or "") doesn't work with textarea
- Wrong sorting: list of languages HOT 5
- Jobs queue HOT 1
- Provide documentation for this version HOT 2
- Get unpublished collection items HOT 1
- UX Suggestion: Dismiss confirmation modal with ESC HOT 3
- How to upload assets via API?
- [BUG] Collection can't remove correctly.
- Collection List Blank on broken Content Link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cockpit.