I have Nginx as reverse proxy to a backend server that proxies multiple applications.
While everything works for the most of the time, here I am experiencing JS error Uncaught TypeError: Cannot read properties of undefined (reading ‘transform’).
When accessing backend directly, of course everything is OK, and as well. As soon as I involve nginx, error is there.
Nginx config as below:
server {
listen 443 ssl;
server_name myproxydomain.com;
ssl_certificate /path/to/my/ssl_certificate.crt;
ssl_certificate_key /path/to/my/ssl_certificate.key;
location / {
proxy_pass https://backenddomain.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
sub_filter_types *;
sub_filter_once off;
sub_filter 'backenddomain.com' 'myproxydomain.com';
> > > }
> > > }
Part of JS code error is caught:
function internalContinueImporting() {
if (globalImporter.state != Importer.State.Idle) {
var ret = globalImporter.Advance(JsonsToImport, globalGamePath);
LoaderProgress.Import_Current = globalImporter.currentProgress;
if (ret.isDone && allGameJSONSadded) {
LoaderProgress.Import_Current = globalImporter.totalNumberOfSteps;
globalImporter.clear();
var parent = ret.objects[JsonTypes.indexOf(0)].GetComponentsInChildren(LocalizationRoot, true)[0].transform;
var GUIGo = ret.objects[JsonTypes.indexOf(1)].transform;
var commonExtraGo = GUIGo.children[GUIGo.children.length - 1];
commonExtraGo.SetParent(parent, false);
GUIGo.SetParent(parent, false);
for (var i = 0; i < ret.objects.length; ++i)
if (JsonTypes[i] > 1)
ret.objects[i].transform.SetParent(parent, false);
globalRuntime.addNewSceneRoot(ret.objects[JsonTypes.indexOf(0)]);
mainGameJsonData = null;
GUIJsonData = null;
mainResources = null;
otherResources = null;
GUIResources = null;
modulesJsonData = null
}
}
}
I have tried various configuration changes, but nothing seems to helped so far. I am hoping to find a solution or at least some clue in the right direction.
Also, all files, especially JS ones are loading properly using nginx.
I am using some sub_filter directives, and they are working as intended. (Compared outcome with another proxy server that seems to work correctly)
Milan Najerica is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.