@@ -72,3 +72,42 @@ curl -sX GET "${BROKER_URL}/v2/subscriptions" -H "Accept: application/json" | jq
72
72
These cURL commands should help you interact with the FIWARE broker and test the
73
73
Redmine GTT FIWARE plugin effectively. If you encounter any issues or need
74
74
further assistance, please let us know!
75
+
76
+ #### CORS Issues
77
+
78
+ If you encounter CORS issues, for example when you use FIWARE-Big-Bang, you can extend
79
+ the Ngix configuration as follows:
80
+
81
+ ``` nginx
82
+ [snip]
83
+
84
+ server {
85
+ [snip]
86
+
87
+ # Add CORS Headers
88
+ add_header 'Access-Control-Allow-Origin' '*' always;
89
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
90
+ add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
91
+ add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
92
+
93
+ location / {
94
+ if ($request_method = 'OPTIONS') {
95
+ add_header 'Access-Control-Allow-Origin' '*' always;
96
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
97
+ add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
98
+ add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
99
+ add_header 'Access-Control-Max-Age' 1728000;
100
+ add_header 'Content-Type' 'text/plain charset=UTF-8';
101
+ add_header 'Content-Length' 0;
102
+ return 204;
103
+ }
104
+
105
+ [snip]
106
+ }
107
+
108
+ [snip]
109
+ }
110
+ ```
111
+
112
+ In particular ` location ` and ` fiware-service, fiware-servicepath ` are important
113
+ for the FIWARE broker to work correctly.
0 commit comments