Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5944

Nginx Rewrite : test.x.x.x.js to test.js

$
0
0

need some help. I have this nginx config

server {    listen 80;    server_name localhot;    root /opt/apps;    index index.php index.html index.htm index.nginx-debian.html;    client_max_body_size 512M;    server_tokens off;    access_log /var/log/nginx/access.log;    error_log /var/log/nginx/error.log debug;    error_page 404 /404.html;    location ~ \.php$ {            include snippets/fastcgi-php.conf;            fastcgi_read_timeout 600s;            fastcgi_connect_timeout 300s;            fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;    }    location /test.js {            rewrite ^/test\.(.*)\.js$ /test.$1.js last;    }    location /api/ {            rewrite ^/api/(.*)$ /api.php/$1 last;    }}

i have file localhost/test.2.1.9.js, it is accessible but when i try to access localhost/test.js it returns 404.


Viewing all articles
Browse latest Browse all 5944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>