<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                前后端分離模式下的跨域訪問: ~~~ upstream tomcat_server { server 10.25.39.131:8080; server 10.25.39.132:8080; } server { listen 80; server_name www.wxvote.com; ##注意: ##"proxy_pass"中的路徑只能到端口,否則報: cannot have URI part in location given by regular expression location ~* \.(html|css|js|gif|jpg|jpeg|mp4)$ { proxy_pass http://10.25.39.140:8020; } location / { proxy_pass http://tomcat_server/; proxy_set_header Host $host; } } ~~~ 訪問現有的ajax服務 例如:訪問心知天氣。 ~~~ server { listen 80; server_name localhost; location ~* \.(html|css|js|gif|jpg|jpeg|mp4)$ { root weather; } location / { proxy_pass http://api.seniverse.com; } } ~~~ springboot配置跨域 ``` package com.example.demo.config; import static org.springframework.web.cors.CorsConfiguration.ALL; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpHeaders; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration @ComponentScan(basePackages={"com.example.demo"}) public class SpringConfig { //增加跨域權限配置 @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override public void addCorsMappings(CorsRegistry registry) { // 限制了路徑和域名的訪問 /*registry.addMapping("/api*").allowedOrigins("http://localhost:8081");*/ //設置允許跨域的路徑 registry.addMapping("/**") //設置允許跨域請求的域名 // .allowedOrigins(ALL) //設置允許跨域請求的域名,如果想要傳遞cookie,就不能再用* .allowedOrigins("http://localhost:9527") //是否允許證書 不再默認開啟 .allowCredentials(true) //設置允許的方法 .allowedMethods(ALL) //設置允許的header .allowedHeaders(ALL) //.exposedHeaders(HttpHeaders.SET_COOKIE, "token") //跨域允許時間 .maxAge(3600); registry.addMapping("/**") //設置允許跨域請求的域名 // .allowedOrigins(ALL) //設置允許跨域請求的域名,如果想要傳遞cookie,就不能再用* .allowedOrigins("http://localhost:8081") //是否允許證書 不再默認開啟 .allowCredentials(true) //設置允許的方法 .allowedMethods(ALL) //設置允許的header .allowedHeaders(ALL) //.exposedHeaders(HttpHeaders.SET_COOKIE, "token") //跨域允許時間 .maxAge(3600); } }; } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看