Closed mrmarchone closed 3 years ago
What's your output?
Swoole runs in an asynchronous way, so, basically, your entire framework will be loaded in your RAM just once and you will be the responsable to clear all the instances that you could be using. By your (short) description, I think that your location is cached at first request and being shared to the others resquest.
Please, make sure that you're doing the right cleaning of your instances.
Check your config/swoole_http.php file and try to make use of instances array
i have the same problem with laravel translatable package that use mcamara package problem is any route have translatable middleware redirect to APP_URL/lang example domain.com/dashboard => domain.com/en it's should redirect to => domain.com/en/dashboard this issue only with swoole server
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name forera.develop;
root /var/www/html/forera/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
add_header Vary "Accept-Language";
index index.php;
charset utf-8;
location / {
# try_files $uri $uri/ /index.php?$query_string;
try_files /not_exists @swoole;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix ?$query_string;
}
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Vary Accept-Language;
# IF https
# proxy_set_header HTTPS "on";
proxy_pass http://127.0.0.1:1215$suffix;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Are your middleware being reached?
yes middleware is => LocaleSessionRedirect
it's depend on LaravelLocalization
Hum, got it. I'll try to reproduce it
@Arkanius any updates ?
not yet. I didn't get time to try =/
i will try with it, just tell me from where i should start debug Like (files responsible of this redirection, middleware, ...)
Well, the first thing I'd debug is if your middleware is being reached. Try to check the follow:
Hello i installed the package named mcamara for localization and put it's middlewares in kernel.php , it's working when i serve from php artisan serve, but when serve from php artisan swoole:http start it's not working ? Why ?