How to get a cross-origin resource sharing (CORS) post request working

后端 未结 11 2229
野趣味
野趣味 2020-11-21 22:35

I have a machine on my local lan (machineA) that has two web servers. The first is the in-built one in XBMC (on port 8080) and displays our library. The second server is a

11条回答
  •  醉酒成梦
    2020-11-21 23:12

    If for some reasons while trying to add headers or set control policy you're still getting nowhere you may consider using apache ProxyPass…

    For example in one that uses SSL add the two following directives:

    SSLProxyEngine On
    ProxyPass /oauth https://remote.tld/oauth
    

    Make sure the following apache modules are loaded (load them using a2enmod):

    • proxy
    • proxy_connect
    • proxy_http

    Obviously you'll have to change your AJAX requests url in order to use the apache proxy…

提交回复
热议问题