Discover Centmin Mod today
Register Now

How can I enable CORS for Nginx?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, May 9, 2017.

  1. pamamolf

    pamamolf Premium Member Premium Member

    3,989
    414
    83
    May 31, 2014
    Ratings:
    +804
    Local Time:
    3:05 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed:1.13.0
    • PHP Version Installed: 7.0.18
    • MariaDB MySQL Version Installed: 10.1.23
    • When was last time updated Centmin Mod code base ? : just now


    Hello :)


    How can I enable CORS for Nginx?

    https://enable-cors.org/server_nginx.html

    Do I need to recompile?
    What parameters to use?
    Any way to make it persistent?

    Can that cause any issues related to Let's Encrypt?

    Thank you
     
  2. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    10:05 AM
    Nginx 1.21.x
    MariaDB 10.x
    no CORS is purely nginx header configuration you need to figure out and yes it can cause issues if misconfigured

    you're on your own configuring CORS headers, read https://enable-cors.org/resources.html

    Using CORS - HTML5 Rocks