Hello,
Can you help me to make it working ?
I'm trying to setup url rewriting with Picocms.
When I activate it, it works but I have a 404 on css, js and assets.
Here is my config :
rewrite ^/site$ /site/ permanent;
location /site/ {
alias /var/www/webapp/main_site/ ;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.html index.php ;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-webapp_main_site.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;
# when activated urls are ok /site/content/sub instead of /site/?content/?sub
fastcgi_param PICO_URL_REWRITING 1;
}
location ~ ^/site/ {
try_files $uri $uri/ /site/index.php$is_args$args;
}
}
The css, js, etc are under /var/www/webapp/main_site/themes/default/…
The assets are under /var/www/webapp/main_site/assets/…
I tried to understand how it works, but it's above my understanding and try / test different things was not successful until now.
So some help / advises would be nice.
Thanks
Can you help me to make it working ?
I'm trying to setup url rewriting with Picocms.
When I activate it, it works but I have a 404 on css, js and assets.
Here is my config :
rewrite ^/site$ /site/ permanent;
location /site/ {
alias /var/www/webapp/main_site/ ;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.html index.php ;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-webapp_main_site.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;
# when activated urls are ok /site/content/sub instead of /site/?content/?sub
fastcgi_param PICO_URL_REWRITING 1;
}
location ~ ^/site/ {
try_files $uri $uri/ /site/index.php$is_args$args;
}
}
The css, js, etc are under /var/www/webapp/main_site/themes/default/…
The assets are under /var/www/webapp/main_site/assets/…
I tried to understand how it works, but it's above my understanding and try / test different things was not successful until now.
So some help / advises would be nice.
Thanks