Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mohammad6006's avatar

apache to nginx

I need to define rule in my nginx server when I go site.com/play/gamename

it have css and js file and load url is site.com/play/gamename/script.js but script.js is in site.com/uploads/games/gamename/script.js and I want to load from this address

how can define this rule in nginx

I had this in my htaccess in previous apache server

    RewriteCond %{REQUEST_URI} \.(jpg|png|css|js|appcache|xml|ogg|m4a)$
    RewriteRule ^play/(.+) username/public/uploads/games/ [L]
0 likes
1 reply

Please or to participate in this conversation.