mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-09-21 03:11:39 +08:00
Centralise query string generation & fallback to hash if too long
This commit is contained in:
@@ -24,19 +24,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import qs from 'qs';
|
||||
import sslProfiles from '../../util/ssl_profiles';
|
||||
import exportData from '../../util/export_data';
|
||||
import websiteConf from './website.conf';
|
||||
import shareQuery from '../../util/share_query';
|
||||
|
||||
export default (domains, global) => {
|
||||
const config = {};
|
||||
|
||||
// Source
|
||||
config['# Generated by nginxconfig.io'] = '';
|
||||
const data = exportData(domains.map((domain, index) => [domain, index]).filter(d => d[0] !== null), global);
|
||||
const query = qs.stringify(data, { allowDots: true });
|
||||
config[`# ${window.location.protocol}//${window.location.host}${window.location.pathname}${query.length ? '?' : ''}${query}`] = '';
|
||||
const query = shareQuery(domains.map((domain, index) => [domain, index]).filter(d => d[0] !== null), global);
|
||||
config[`# ${window.location.protocol}//${window.location.host}${window.location.pathname}${query}`] = '';
|
||||
|
||||
// Basic nginx conf
|
||||
config.user = global.nginx.user.computed;
|
||||
|
Reference in New Issue
Block a user