FRANCAIS
Bonjour,
J’essaie d’utiliser le CMS [Translucide] (GitHub - simonvdfr/Translucide: CMS efficient, léger, simple à prendre en main, customisable et écoconçu !) avec une Webapp personnalisée.
Sur mon ordinateur, la conf nginx est aussi simple que la suivante :
server {
listen 80 ;
listen [: :]:80 ;
root /home/thatoo/public_html/mywebsite ;
# Ajoutez index.php à la liste si vous utilisez PHP
index index.php index.html index.htm ;
server_name mywebsite.local ;
# N'autorisez pas l'accès aux fichiers point (comme .htaccess)
location ~ /\. {
deny all ;
}
location / {
# Première tentative pour servir la requête en tant que fichier, puis
# en tant que répertoire, puis de revenir à l'affichage d'un 404.
try_files $uri $uri/ /index.php?$args ;
}
# Passer les scripts PHP au serveur FastCGI
location ~ \.php$ {
include snippets/fastcgi-php.conf ;
# paramètres par défaut de fastcgi
include fastcgi_params ;
# # Avec php-fpm (ou d'autres sockets unix) :
fastcgi_pass unix:/run/php/php7.3-fpm.sock ;
}
}
J’ai configuré, sur yunohost, my WebApp sur URL + PATH : https:// mywebsite.com / site
et c’est l’application par défaut pour ce nom de domaine.
La conf nginx créée par My WebApp dans Yunohost est alors la suivante
rewrite ^/site$ /site/ permanent ;
location /site/ {
# Chemin vers la source
alias /var/www/my_webapp/www/ ;
# Index par défaut et fourre-tout
index index.html index.php ;
try_files $uri $uri/ /site/index.php?$args ;
# Eviter les logs inutiles
location = /site/favicon.ico {
log_not_found off ;
access_log off ;
}
location = /site/robots.txt {
autorise tout ;
log_not_found off ;
journal d'accès désactivé ;
}
# Refuser l'accès aux fichiers et répertoires cachés
location ~ ^/site/(.+/|)\.(?!well-known\/) {
refuse tout ;
}
# Exécuter et servir les fichiers PHP
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$ ;
fastcgi_pass unix:/var/run/php/php7.3-fpm-my_webapp.sock ;
fastcgi_index index.php ;
include fastcgi_params ;
fastcgi_param REMOTE_USER $remote_user ;
fastcgi_param PATH_INFO $fastcgi_path_info ;
fastcgi_param SCRIPT_FILENAME $request_filename ;
}
# Inclure le panneau utilisateur SSOWAT.
include conf.d/yunohost_panel.conf.inc ;
}
Dans le fichier de configuration du CMS Translucide, j’ai rempli les infos ainsi :
$GLOBALS['scheme'] = "https://" ;
$GLOBALS['domain'] = "mywebsite.com" ;
$GLOBALS['path'] = "/site/" ;
Lorsque je vais sur https://mywebsite.com
, il redirige vers https://mywebsite.com/site
et affiche joliment la page d’accueil. Cela fonctionne comme prévu.
Cependant, dès que je vais sur une autre page, disons https://mywebsite.com/site/who-are-we
, il redirige vers https://myyunohostdomain.com/yunohost/sso
et aucune autre page ne peut être affichée.
Si quelqu’un a une idée, je lui en serai très reconnaissant.
Meilleures salutations à tous,
Thatoo
ENGLISH
Hello,
I’m trying to use the CMS Translucide with Custom Webapp.
On my computer, nginx conf is as simple as follow :
server {
listen 80;
listen [::]:80;
root /home/thatoo/public_html/mywebsite;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
server_name mywebsite.local;
# Don't allow access to dotfiles (such as .htaccess)
location ~ /\. {
deny all;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$args;
}
# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# default fastcgi settings
include fastcgi_params;
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}
I have set, on yunohost, my custom web app on
URL + path : https:// mywebsite.com / site
and it is the default app for this domain name
The nginx conf is then as follow
rewrite ^/site$ /site/ permanent;
location /site/ {
# Path to source
alias /var/www/my_webapp/www/;
# Default indexes and catch-all
index index.html index.php;
try_files $uri $uri/ /site/index.php?$args;
# Prevent useless logs
location = /site/favicon.ico {
log_not_found off;
access_log off;
}
location = /site/robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny access to hidden files and directories
location ~ ^/site/(.+/|)\.(?!well-known\/) {
deny all;
}
# Execute and serve PHP files
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm-my_webapp.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
The config file of Translucide CMS is filled as follow :
$GLOBALS['scheme'] = "https://";
$GLOBALS['domain'] = "mywebsite.com";
$GLOBALS['path'] = "/site/";
When I go to https://mywebsite.com
it redirect to https://mywebsite.com/site
and it displays nicely the homepage. It works as expected.
However, as soon as I go on an other page, let’s say https://mywebsite.com/site/who-are-we
then it redirects to
so no other pages can be displayed.
If anyone has any idea, I’ll be very much thankfull.
Best regards to all,
Thatoo