clarkwinkelmann Thanks for your answer
I changed as you said, but I'm still ketting the "oops" error (admin is now a 403 (because I can't connect) and api isn't a 404 anymore)
Here's my file now
server {
listen 80;
server_name forum.epitech2022.eu www.forum.epitech2022.eu;
rewrite ^/$ https://www.forum.epitech2022.eu/ permanent;
rewrite ^/(.*)$ https://www.forum.epitech2022.eu/$1 permanent;
}
server {
listen 443 ssl;
root /var/www/epitech/html/forum;
index index.php index.html index.htm;
server_name forum.epitech2022.eu www.forum.epitech2022.eu;
ssl on;
ssl_certificate /etc/letsencrypt/live/www.epitech2022.eu/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/www.epitech2022.eu/privkey.pem;
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {#
expires 200h;
access_log off;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location /flarum {
deny all;
return 404;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY "";
fastcgi_index index.php;
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/xml;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
}
EDIT: I'm getting this error only when I use www.forum.epitech2022.eu, when I use forum.epitech2022.eu it's working fine
I just added a permanent redirect to forum.epitech2022.eu when using www.forum.epitech2022 and now it's working, thank you